Skip to main content

Plugin API Reference

This reference is generated directly from the plugin contract assemblies and their XML documentation comments, so it always reflects the extension surface of the installed version. Types are grouped by namespace. Interfaces you implement in a plugin are listed first within each group.

LANCommander.SDK.Plugins​

ILobbyProvider​

interface — LANCommander.SDK.Plugins.ILobbyProvider

Implemented by launcher plugins that can find multiplayer lobbies for an installed game, for example the lobbies a player's friends are hosting on a platform like Steam. Register the implementation in ConfigureServices.

Methods

  • Task<IEnumerable<GameLobby>> GetLobbiesAsync(LobbyQuery query, CancellationToken cancellationToken)
    • Returns the lobbies currently available for the game.

IPlugin​

interface — LANCommander.SDK.Plugins.IPlugin

The entry point contract every LANCommander plugin implements. Plugins are discovered from the host's Plugins drop-in folder and loaded once at startup.

Properties

  • string Id { get; }
    • Stable, globally unique identifier (e.g. "com.acme.myplugin").
  • string Name { get; }
    • Human readable display name.
  • string Version { get; }
    • Plugin version (SemVer recommended).
  • string Author { get; }
    • Plugin author.

Methods

  • void ConfigureServices(IServiceCollection services)
    • Registers the plugin's own services into the host's DI container. Called during host startup before the service provider is built, so implementations must only register services and must not attempt to resolve them.
  • Task InitializeAsync(PluginContext context, CancellationToken cancellationToken)
    • Asynchronous startup hook, invoked after the host's service provider is built. Use this to resolve services, subscribe to lifecycle events, register UI extensions, etc.

IPluginEventBus​

interface — LANCommander.SDK.Plugins.IPluginEventBus

A minimal in-process, strongly-typed event aggregator that lets plugins react to host lifecycle events (game install/launch/uninstall, login, etc.). Registered as a singleton in both hosts.

Methods

  • IDisposable Subscribe<TEvent>(Func<TEvent, CancellationToken, Task> handler)
    • Subscribes a handler to events of type TEvent.
  • Task PublishAsync<TEvent>(TEvent event, CancellationToken cancellationToken)
    • Publishes an event to all subscribed handlers. Each handler is awaited and isolated so a throwing handler cannot break the publisher or other handlers.

IPluginPowerShellExtension​

interface — LANCommander.SDK.Plugins.IPluginPowerShellExtension

Implemented by plugins that want to add PowerShell cmdlets or script modules into the LANCommander runspace. Register the implementation in ConfigureServices; the SDK's PowerShell runspace picks up all registered extensions when a script is executed.

Methods

  • IEnumerable<Type> GetCmdletTypes()
    • Returns cmdlet types (classes decorated with [Cmdlet]) to register into each runspace.
  • IEnumerable<string> GetModulePaths()
    • Returns absolute paths to PowerShell script modules (.psm1/.psd1) shipped with the plugin that should be imported into each runspace.

IPluginSettings<TSettings>​

interface — LANCommander.SDK.Plugins.IPluginSettings<TSettings>

A plugin's own settings, kept by the host in a YAML file of their own: Data/Settings.yaml in the plugin's own folder (see DataDirectory). Inject it with the plugin's settings type; the host knows which plugin is asking from the assembly that type is declared in, so a plugin can only reach its own file.

Properties

  • TSettings Current { get; }
    • The settings, read from the file on first use, or the type's defaults when there is none.

Methods

  • void Update(Action<TSettings> mutator)
    • Changes the settings and schedules them to be written.
  • Task FlushAsync(CancellationToken cancellationToken)
    • Writes a pending change now instead of after the debounce, for a value that must not be lost to a crash, such as a rotated credential.

GameLobby​

record — LANCommander.SDK.Plugins.GameLobby

A multiplayer lobby the player can join.

Properties

  • string Id { get; init; }
    • The lobby's id on the platform that hosts it.
  • string HostName { get; init; }
    • Name of the player hosting the lobby, shown as "Join {HostName}'s lobby".
  • string JoinArguments { get; init; }
    • Arguments appended to the game's primary action to join the lobby, for example +connect_lobby 109775241055537385.

LANCommanderPluginAttribute​

attribute — LANCommander.SDK.Plugins.LANCommanderPluginAttribute

Assembly-level attribute that marks an assembly as a LANCommander plugin and declares its entry point and compatibility metadata. This is the primary discovery mechanism used by the loader.

Properties

  • Type EntryPoint { get; }
    • The concrete type implementing IPlugin that serves as the entry point.
  • string Id { get; set; }
    • Optional override for the plugin id; when null the loader falls back to the instance's Id.
  • string MinHostVersion { get; set; }
    • Minimum compatible host (SDK) version, inclusive. Null means no lower bound.
  • string MaxHostVersion { get; set; }
    • Maximum compatible host (SDK) version, inclusive. Null means no upper bound.
  • PluginHost Hosts { get; set; }
    • The hosts this plugin supports. Defaults to both server and launcher.
  • string DataId { get; set; }
    • The name the plugin's database objects go by: with DataId = "Timesheet", its tables are Plugin_Timesheet_Entries, its keys PK_Plugin_Timesheet_Entries, and its migrations history __EFMigrationsHistory_Plugin_Timesheet. A PascalCase name of letters and digits, at most 24 characters, unique among installed plugins ignoring case. Required only for a plugin with a database context; unlike Id, it must never change once the plugin has been installed, since it names the plugin's tables.
  • string[] MigrationAssemblies { get; set; }
    • The plugin's migrations assemblies, by file or assembly name, one per database engine per context, shipped in the plugin's folder. Each declares what it contains with [assembly: PluginMigrations(...)], which is what the host goes by.

LoadedPlugin​

record — LANCommander.SDK.Plugins.LoadedPlugin

A plugin the loader has configured: its entry point and the manifest it was loaded from.

Properties

  • IPlugin Plugin { get; init; }
  • PluginManifest Manifest { get; init; }

LobbyQuery​

record — LANCommander.SDK.Plugins.LobbyQuery

The installed game a ILobbyProvider is asked to find lobbies for.

Properties

  • Guid GameId { get; init; }
    • Id of the game.
  • string InstallDirectory { get; init; }
    • Directory the game is installed in.
  • IReadOnlyList<Game> Manifests { get; init; }
    • The manifests of the game and its installed addons.

PluginBootstrap​

class — LANCommander.SDK.Plugins.PluginBootstrap

Convenience helper that centralizes plugin discovery so every host wires it identically. Call ConfigurePlugins as the last step while populating the service collection (before building the provider), then call InitializeAllAsync on the returned loader after the provider is built.

Methods

  • bool IsPluginFolder(string name)
    • Whether a folder in the plugins folder holds a plugin. Folders named with a leading dot, such as the server's .staging, belong to the host.
  • PluginLoaderService ConfigurePlugins(IServiceCollection services, PluginHost host)
    • Discovers plugins for host from <config>/Plugins, lets each register its services into services, and registers the loader as a singleton so the same instance can drive Phase 2 initialization.

PluginContext​

class — LANCommander.SDK.Plugins.PluginContext

Runtime context handed to a plugin during InitializeAsync.

Properties

  • PluginHost Host { get; init; }
    • The host the plugin is running inside (a single value, never a flags combination).
  • IServiceProvider Services { get; init; }
    • The host service provider scoped to the current InitializeAsync call. Resolve services needed during initialization, but do not retain this provider or scoped services after initialization completes.
  • string PluginDirectory { get; init; }
    • Absolute path to the folder the plugin was loaded from.
  • string DataDirectory { get; init; }
    • See DataDirectory.
  • ILogger Logger { get; init; }
    • Logger scoped to the plugin.

PluginEventBus​

class — LANCommander.SDK.Plugins.PluginEventBus

Methods

  • IDisposable Subscribe<TEvent>(Func<TEvent, CancellationToken, Task> handler)
  • Task PublishAsync<TEvent>(TEvent event, CancellationToken cancellationToken)

PluginLoadContext​

class — LANCommander.SDK.Plugins.PluginLoadContext

An isolated AssemblyLoadContext for a single plugin. Uses an AssemblyDependencyResolver to resolve the plugin's private dependencies while deferring host-provided assemblies (the SDK, DI abstractions, Avalonia, etc.) to the default context so that shared types keep a single identity across the ALC boundary.

PluginLoaderService​

class — LANCommander.SDK.Plugins.PluginLoaderService

Discovers, loads, and initializes plugins from a drop-in folder. Split into two phases to match the "build the DI container once" constraint: DiscoverAndConfigure runs while the host is still populating its IServiceCollection (before the provider is built).InitializeAllAsync runs after the provider has been built.

Properties

  • IReadOnlyList<PluginManifest> LoadedPlugins { get; }
    • Plugins successfully loaded and configured during discovery.
  • IReadOnlyList<LoadedPlugin> Plugins { get; }
    • The loaded plugins' entry points alongside their manifests.

Methods

  • LoadedPlugin FindByAssembly(Assembly assembly)
    • The loaded plugin assembly belongs to: its main assembly, or one loaded into its context.
  • void Disable(string pluginId, IReadOnlyList<string> reasons)
    • Turns a loaded plugin off: its InitializeAsync isn't run, and the host shows reasons to administrators. The plugin stays loaded, since its services are already part of the host's container.
  • void Enable(string pluginId)
    • Turns a plugin back on. Doesn't initialize it; see InitializeAsync.
  • IReadOnlyList<string> GetDisabledReasons(string pluginId)
    • Why a plugin is turned off, or null when it isn't.
  • bool IsInitialized(string pluginId)
  • void DiscoverAndConfigure(IServiceCollection services, PluginHost host, string pluginsRoot, string hostVersion, ILogger logger)
    • Phase 1: scans pluginsRoot for plugins, loads each into its own PluginLoadContext, applies host + version gates, instantiates the entry point, and lets it register services. A failure in one plugin never aborts the batch.
  • Task InitializeAllAsync(IServiceProvider serviceProvider, CancellationToken cancellationToken)
    • Phase 2: invokes InitializeAsync for every loaded plugin, each within its own DI scope. A failure in one plugin never aborts the others.
  • Task<bool> InitializeAsync(LoadedPlugin loaded, IServiceProvider serviceProvider, CancellationToken cancellationToken)
    • Invokes one plugin's InitializeAsync within its own DI scope, unless the plugin is turned off or has already been initialized. Returns whether it ran successfully.
  • bool IsVersionCompatible(string hostVersion, string min, string max)
    • Whether hostVersion falls within the inclusive SemVer bounds a plugin declares. A host version that cannot be parsed never blocks a plugin.

PluginManifest​

class — LANCommander.SDK.Plugins.PluginManifest

Parsed metadata describing a discovered plugin, derived from its LANCommanderPluginAttribute.

Properties

  • string Id { get; init; }
  • Type EntryPoint { get; init; }
  • string MinHostVersion { get; init; }
  • string MaxHostVersion { get; init; }
  • PluginHost Hosts { get; init; }
  • Assembly Assembly { get; init; }
    • The assembly the plugin was loaded from.
  • string Directory { get; init; }
    • Absolute path to the folder the plugin was loaded from.
  • string DataDirectory { get; }
    • Absolute path to the folder for the plugin's own files: its settings and anything else it keeps. It lives inside Directory, survives the plugin being upgraded, and goes when the plugin is removed. It may not exist yet. Plugins get it with GetDataDirectory.
  • string DataId { get; init; }
    • See DataId.
  • IReadOnlyList<string> MigrationAssemblies { get; init; }
    • See MigrationAssemblies.

Methods

  • PluginManifest FromAttribute(LANCommanderPluginAttribute attribute, Assembly assembly, string directory)
    • Builds a manifest from an assembly-level plugin attribute.

PluginPackageTypes​

class — LANCommander.SDK.Plugins.PluginPackageTypes

The NuGet package types a plugin package declares. Every plugin package declares Plugin, plus the type of each host it runs on; hosts search their package sources for their own type.

Methods

  • string For(PluginHost host)
    • The package type a host searches for.
  • IReadOnlyList<string> All(PluginHost hosts)
    • Every package type a plugin targeting hosts declares.

PluginPaths​

class — LANCommander.SDK.Plugins.PluginPaths

Where a plugin keeps its files, for code that runs before PluginContext is available, such as service registrations in ConfigureServices.

Methods

  • string GetDataDirectory<T>()
    • The plugin's data folder (see DataDirectory), found from any type in the plugin's main assembly: PluginPaths.GetDataDirectory<MyPlugin>(). It may not exist yet.
  • string GetDataDirectory(Assembly assembly)
  • string GetPluginDirectory(Assembly assembly)
    • The folder the plugin was loaded from (see Directory).

PluginSettings<TSettings>​

class — LANCommander.SDK.Plugins.PluginSettings<TSettings>

The host's IPluginSettings. Register it as an open generic singleton.

Properties

  • TSettings Current { get; }

Methods

  • void Update(Action<TSettings> mutator)
  • Task FlushAsync(CancellationToken cancellationToken)
  • ValueTask DisposeAsync()
  • void Dispose()
    • For containers disposed synchronously.

PluginHost​

enum — LANCommander.SDK.Plugins.PluginHost

Identifies which LANCommander host a plugin targets. Used both as a single value (the host a plugin is being loaded into) and as a flags set (the hosts a plugin declares support for).

ValueDescription
None = 0
Server = 1
Launcher = 2

LANCommander.SDK.Plugins.Events​

GameAfterExitEvent​

record — LANCommander.SDK.Plugins.Events.GameAfterExitEvent

Raised immediately after a launched game process exits.

Properties

  • Guid GameId { get; init; }
  • string InstallDirectory { get; init; }

GameBeforeLaunchEvent​

record — LANCommander.SDK.Plugins.Events.GameBeforeLaunchEvent

Raised immediately before a game's executable is launched.

Properties

  • Guid GameId { get; init; }
  • string InstallDirectory { get; init; }
  • string Action { get; init; }

GameInstallFailedEvent​

record — LANCommander.SDK.Plugins.Events.GameInstallFailedEvent

Raised when a game install fails.

Properties

  • Guid GameId { get; init; }
  • string InstallDirectory { get; init; }

GameInstalledEvent​

record — LANCommander.SDK.Plugins.Events.GameInstalledEvent

Raised after a game has finished installing.

Properties

  • Guid GameId { get; init; }
  • string InstallDirectory { get; init; }

GameInstallingEvent​

record — LANCommander.SDK.Plugins.Events.GameInstallingEvent

Raised just before a game install begins.

Properties

  • Guid GameId { get; init; }
  • string InstallDirectory { get; init; }

GameUninstalledEvent​

record — LANCommander.SDK.Plugins.Events.GameUninstalledEvent

Raised after a game has finished uninstalling.

Properties

  • Guid GameId { get; init; }

GameUninstallingEvent​

record — LANCommander.SDK.Plugins.Events.GameUninstallingEvent

Raised just before a game is uninstalled.

Properties

  • Guid GameId { get; init; }
  • string InstallDirectory { get; init; }

InstallQueueChangedEvent​

record — LANCommander.SDK.Plugins.Events.InstallQueueChangedEvent

Raised whenever the install/download queue changes.

UserLoggedInEvent​

record — LANCommander.SDK.Plugins.Events.UserLoggedInEvent

Raised after a user successfully logs in.

Properties

  • Guid UserId { get; init; }
  • string UserName { get; init; }

UserLoggedOutEvent​

record — LANCommander.SDK.Plugins.Events.UserLoggedOutEvent

Raised after a user logs out.

Properties

  • Guid UserId { get; init; }
  • string UserName { get; init; }

LANCommander.Launcher.Plugins.Extensions​

IContextMenuExtension​

interface — LANCommander.Launcher.Plugins.Extensions.IContextMenuExtension

Adds items to a game's context menu. Implementations are resolved from DI and their items appended to the consolidated game menu shown on covers and list rows.

Properties

  • int Order { get; }
    • Relative position among extension items; lower values appear first.

Methods

  • IEnumerable<Control> BuildMenuItems(Guid gameId)
    • Builds the menu items shown for the given game (typically MenuItems).

IFooterExtension​

interface — LANCommander.Launcher.Plugins.Extensions.IFooterExtension

Adds a control to the launcher shell's footer. Implementations are resolved from DI and rendered, ordered by Order, alongside the built-in footer items.

Properties

  • int Order { get; }
    • Relative position among extension items; lower values appear first.

Methods

  • Control BuildContent()
    • Builds the control rendered in the footer.

IGameDetailTabExtension​

interface — LANCommander.Launcher.Plugins.Extensions.IGameDetailTabExtension

Adds an additional tab to a game's detail view. Implementations are resolved from DI and appended, ordered by Order, after the built-in tabs.

Properties

  • string Header { get; }
    • Header shown on the tab.
  • int Order { get; }
    • Relative position among extension tabs; lower values appear first.

Methods

  • Control BuildContent(Guid gameId)
    • Builds the control rendered inside the tab for the given game.

IGameManageSectionExtension​

interface — LANCommander.Launcher.Plugins.Extensions.IGameManageSectionExtension

Adds an additional section to a game's "Manage" dialog. Implementations are resolved from DI and appended, ordered by Order, after the built-in sections (Options, Modify, Versions) in the left-hand navigation.

Properties

  • string Title { get; }
    • Label shown for the section in the dialog's navigation menu.
  • string IconValue { get; }
    • Phosphor icon name shown next to the section in the navigation menu.
  • int Order { get; }
    • Relative position among extension sections; lower values appear first.

Methods

  • Control BuildContent(Guid gameId)
    • Builds the control rendered in the section's content pane for the given game.

INavigationPageExtension​

interface — LANCommander.Launcher.Plugins.Extensions.INavigationPageExtension

Adds a top-level navigable destination reachable from the launcher shell. The view model is registered with the IViewRegistry so the shell's content control can render the associated view when navigated to.

Properties

  • string Label { get; }
    • Label shown for the navigation entry.
  • int Order { get; }
    • Relative position among extension destinations; lower values appear first.
  • Type ViewModelType { get; }
    • The view model type used both as the navigation target and the registry key.

Methods

  • PluginViewModelBase CreateViewModel()
    • Creates the view model instance shown when the destination is activated.
  • Control BuildView()
    • Builds the control that renders ViewModelType.

ISettingsPageExtension​

interface — LANCommander.Launcher.Plugins.Extensions.ISettingsPageExtension

Adds an additional section to the launcher's settings page. Implementations are resolved from DI and appended, ordered by Order, beneath the built-in settings sections.

Properties

  • string Title { get; }
    • Heading shown for the section.
  • int Order { get; }
    • Relative position among extension sections; lower values appear first.

Methods

  • Control BuildContent()
    • Builds the control rendered inside the section.

LANCommander.Launcher.Plugins​

IViewRegistry​

interface — LANCommander.Launcher.Plugins.IViewRegistry

Maps view model types to the Avalonia controls that render them. Seeded at startup with the launcher's built-in mappings and extended at runtime by plugins that add navigable views. Consumers apply AsDataTemplate to a ContentControl so content is resolved by view model type, replacing the previously hard-coded inline XAML data templates.

Methods

  • void Register(Type viewModelType, Func<Control> factory)
    • Register a control factory for the given view model type.
  • void Register<TViewModel>(Func<Control> factory)
    • Register a control factory for TViewModel.
  • IDataTemplate AsDataTemplate()
    • Build an IDataTemplate backed by the current registrations. Matching prefers the most-derived registered type, preserving the launcher's existing rule that DepotGameDetailViewModel resolves before its GameDetailViewModel base.

PluginViewModelBase​

class — LANCommander.Launcher.Plugins.PluginViewModelBase

Base type for view models supplied by plugins. Lives in this project (rather than the launcher's ViewModels assembly) so plugins can derive from it without taking a dependency on the launcher application itself, avoiding a circular reference.

ViewRegistry​

class — LANCommander.Launcher.Plugins.ViewRegistry

Methods

  • void Register(Type viewModelType, Func<Control> factory)
  • void Register<TViewModel>(Func<Control> factory)
  • IDataTemplate AsDataTemplate()

LANCommander.Server.Plugins​

IActionProvider​

interface — LANCommander.Server.Plugins.IActionProvider

Manages the actions of games (per version), tools and servers. Provided by the server; inject it into a scoped plugin service or page.

IArchiveProvider​

interface — LANCommander.Server.Plugins.IArchiveProvider

Lists and deletes archives. Provided by the server; inject it into a scoped plugin service or page. Archives are added by importing a package through IPackageImporter.

Methods

  • Task<IReadOnlyList<ArchiveInfo>> GetAsync(RecordOwner owner, CancellationToken cancellationToken)
    • The archives of a game, redistributable or tool, newest first. For a game, every version's archive unless the owner names a version.
  • Task<ArchiveInfo> GetArchiveAsync(Guid id, CancellationToken cancellationToken)
    • The archive with the given id, or null.
  • Task DeleteAsync(Guid id, CancellationToken cancellationToken)
    • Deletes an archive and its file. Does nothing when there is no such archive.

IGameProvider​

interface — LANCommander.Server.Plugins.IGameProvider

Lists and manages the server's games and add-ons, and their links, external ids and custom fields. Provided by the server; inject it into a scoped plugin service or page.

Methods

  • Task<IReadOnlyList<GameInfo>> GetAsync(CancellationToken cancellationToken)
    • Every game and add-on, ordered by title.
  • Task<GameInfo> GetAsync(Guid id, CancellationToken cancellationToken)
    • The game with the given id, or null.
  • Task<IReadOnlyList<GameInfo>> GetAddonsAsync(Guid baseGameId, CancellationToken cancellationToken)
    • The add-ons of a game, ordered by title.
  • Task<GameInfo> FindByExternalIdAsync(string provider, string externalId, CancellationToken cancellationToken)
    • The game recorded under an id in another service, or null.
  • Task<GameInfo> AddAsync(GameInfo game, CancellationToken cancellationToken)
    • Adds a game.
  • Task<GameInfo> UpdateAsync(GameInfo game, CancellationToken cancellationToken)
    • Writes every field of a game.
  • Task DeleteAsync(Guid id, CancellationToken cancellationToken)
    • Deletes a game along with its archives and media, files included. Does nothing when there is no such game.
  • Task<IReadOnlyList<Guid>> GetLinksAsync(Guid gameId, GameLinkKind kind, CancellationToken cancellationToken)
    • The ids of the records a game is linked to.
  • Task SetLinksAsync(Guid gameId, GameLinkKind kind, IEnumerable<Guid> ids, CancellationToken cancellationToken)
    • Replaces the records a game is linked to. An empty list unlinks them all.
  • Task<string> GetRedistributableOptionsAsync(Guid gameId, Guid redistributableId, CancellationToken cancellationToken)
    • The options a game's latest version passes to a redistributable, as JSON, or null.
  • Task SetRedistributableOptionsAsync(Guid gameId, Guid redistributableId, string optionsJson, CancellationToken cancellationToken)
    • Sets the options a game's latest version passes to a redistributable, as JSON.
  • Task<IReadOnlyList<GameExternalIdInfo>> GetExternalIdsAsync(Guid gameId, CancellationToken cancellationToken)
  • Task<GameExternalIdInfo> SetExternalIdAsync(Guid gameId, string provider, string externalId, CancellationToken cancellationToken)
    • Records the id a game goes by in a service, replacing any it had there.
  • Task RemoveExternalIdAsync(Guid gameId, string provider, CancellationToken cancellationToken)
    • Forgets the id a game goes by in a service. Does nothing when it has none there.
  • Task<IReadOnlyList<GameCustomFieldInfo>> GetCustomFieldsAsync(CancellationToken cancellationToken)
    • Every game's custom fields, including the owning game id. Use this for bulk identity or provenance checks without making a separate request for each game.
  • Task<IReadOnlyList<GameCustomFieldInfo>> GetCustomFieldsAsync(Guid gameId, CancellationToken cancellationToken)
  • Task<GameCustomFieldInfo> SetCustomFieldAsync(Guid gameId, string name, string value, CancellationToken cancellationToken)
    • Sets a custom field, adding it when the game has none by that name.
  • Task RemoveCustomFieldAsync(Guid gameId, string name, CancellationToken cancellationToken)
    • Removes a custom field. Does nothing when the game has none by that name.

IGameVersionProvider​

interface — LANCommander.Server.Plugins.IGameVersionProvider

Lists and manages the versions of games. Provided by the server; inject it into a scoped plugin service or page. A version's archive arrives through IPackageImporter.

Methods

  • Task<IReadOnlyList<GameVersionInfo>> GetAsync(Guid gameId, CancellationToken cancellationToken)
    • A game's versions, oldest first.
  • Task<GameVersionInfo> GetLatestAsync(Guid gameId, CancellationToken cancellationToken)
    • A game's latest version, or null when it has none yet.
  • Task<GameVersionInfo> GetOrCreateLatestAsync(Guid gameId, CancellationToken cancellationToken)
    • The latest version, creating an empty initial version only when the game has none. Does not create a new version or publish a draft when a version already exists.
  • Task<GameVersionInfo> GetVersionAsync(Guid id, CancellationToken cancellationToken)
    • The version with the given id, or null.
  • Task<GameVersionInfo> CreateAsync(Guid gameId, string version, string changelog, CancellationToken cancellationToken)
    • Adds a version after the game's latest, carrying over the latest's actions, scripts, save paths, option schema and redistributables. A draft latest version is published by this.
  • Task<GameVersionInfo> UpdateAsync(GameVersionInfo version, CancellationToken cancellationToken)
    • Writes a version's number, changelog, sort order, published state and option schema.
  • Task DeleteAsync(Guid id, CancellationToken cancellationToken)
    • Deletes a version along with its archive, file included, and its actions, scripts and save paths. Does nothing when there is no such version.
  • Task<IReadOnlyList<GameVersionRedistributableInfo>> GetRedistributablesAsync(Guid versionId, CancellationToken cancellationToken)
    • A version's redistributables and their per-version option values.
  • Task SetRedistributablesAsync(Guid versionId, IEnumerable<Guid> redistributableIds, CancellationToken cancellationToken)
    • Replaces a version's redistributables, preserving options for those kept. An empty list unlinks them all. The game's own list is mirrored according to the server's publishing rules.
  • Task SetRedistributableOptionsAsync(Guid versionId, Guid redistributableId, string optionsJson, CancellationToken cancellationToken)
    • Sets option values as JSON for a redistributable already linked to the version.

IKeyProvider​

interface — LANCommander.Server.Plugins.IKeyProvider

Manages the keys of games. Provided by the server; inject it into a scoped plugin service or page. UpdateAsync changes a key's value only.

Methods

  • Task<IReadOnlyList<KeyInfo>> AddRangeAsync(Guid gameId, IEnumerable<string> values, CancellationToken cancellationToken)
    • Adds several keys to a game, skipping blank values and ones it already has.
  • Task<KeyInfo> ReleaseAsync(Guid id, CancellationToken cancellationToken)
    • Frees a claimed key so it can be handed out again.

IMatchStatisticsProvider​

interface — LANCommander.Server.Plugins.IMatchStatisticsProvider

Reads the multiplayer matches the server has recorded: for a leaderboard, a tournament bracket or anything else built on match results. Provided by the server; inject it into a scoped plugin service or page. Returns the same shapes as the /api/Matches endpoints. Like the record providers, this is a trusted host service, not an authorization boundary.

Methods

  • Task<MatchPage<MatchSummary>> GetMatchesAsync(MatchQuery query, CancellationToken cancellationToken)
    • Matches, newest first.
  • Task<MatchDetail> GetMatchAsync(Guid matchId, CancellationToken cancellationToken)
    • A match with its reporters, participants, results, statistics and attachments, or null.
  • Task<MatchPage<MatchEventInformation>> GetEventsAsync(Guid matchId, MatchEventQuery query, CancellationToken cancellationToken)
    • A match's events in game-time order.
  • Task<IReadOnlyList<MatchStatisticAggregate>> AggregateAsync(MatchStatisticQuery query, CancellationToken cancellationToken)
    • One statistic aggregated across a game's matches, best first: a leaderboard.
  • Task<IReadOnlyList<PlayerIdentityInformation>> GetPlayerIdentitiesAsync(Guid userId, CancellationToken cancellationToken)
    • The in-game ids linked to a user.
  • Task<Stream> OpenAttachmentAsync(Guid attachmentId, CancellationToken cancellationToken)
    • Opens an uploaded attachment's file. The caller owns and must dispose the stream. Null when the attachment doesn't exist or its upload hasn't completed.

IMatchStatisticsSink​

interface — LANCommander.Server.Plugins.IMatchStatisticsSink

Records multiplayer matches from inside the server, without going through HTTP: a plugin that parses a game server's log, polls RCON or receives a game's own reports writes through this. Provided by the server; inject it into a scoped plugin service.

Methods

  • Task<MatchRegistration> CreateMatchAsync(string pluginId, MatchCreateRequest request, CancellationToken cancellationToken)
    • Starts a match, or returns the one already recorded for the game under ExternalId, with the plugin registered as a reporter.
  • Task UpsertParticipantsAsync(Guid matchId, IEnumerable<MatchParticipantSubmission> participants, CancellationToken cancellationToken)
    • Adds players to a match, or updates the name, team and times of ones already in it.
  • Task<MatchEventBatchResult> RecordAsync(Guid matchId, Guid reporterId, IReadOnlyList<MatchEventSubmission> events, CancellationToken cancellationToken)
    • Queues events to be written. Waits while the queue is full rather than failing. Events with an id already written are dropped, so retrying is safe.
  • Task EndMatchAsync(Guid matchId, MatchEndRequest request, CancellationToken cancellationToken)
    • Ends a match with its standings and totals, replacing any sent before.
  • Task<MatchAttachmentInformation> AddAttachmentAsync(Guid matchId, MatchAttachmentCreateRequest request, Stream content, CancellationToken cancellationToken)
    • Stores a file with a match. Reads content from its current position to the end without disposing it.
  • Task<PlayerIdentityInformation> LinkPlayerAsync(PlayerIdentitySubmission identity, CancellationToken cancellationToken)
    • Links an in-game id to a user, so participants with that player key are linked to them, including ones already recorded.

IMediaGrabberExtension​

interface — LANCommander.Server.Plugins.IMediaGrabberExtension

Adds a source to the server's media search, alongside the built-in ones such as HQ and SteamGridDB. Register an implementation in IPlugin.ConfigureServices.

Properties

  • string Name { get; }
    • The name the source is shown and filtered by in the media search. Must be unique among the server's sources.
  • IReadOnlyCollection<MediaType> SupportedMediaTypes { get; }
    • The kinds of media the source can find.
  • bool SupportsPaging { get; }
    • Whether the source returns results in pages. When false, the server asks only for page 0.

Methods

  • Task<IReadOnlyList<MediaGrabberItem>> SearchAsync(MediaType type, string keywords, int page, CancellationToken cancellationToken)
    • Searches for media of one kind. Only called for a type in SupportedMediaTypes. A failure is shown as the source's error without affecting the other sources.

IMediaProvider​

interface — LANCommander.Server.Plugins.IMediaProvider

Manages the media of games. Provided by the server; inject it into a scoped plugin service or page. New files are stored in the server's default media storage location.

Methods

  • Task<IReadOnlyList<MediaInfo>> GetAsync(Guid gameId, CancellationToken cancellationToken)
    • A game's media, ordered by type and sort order.
  • Task<MediaInfo> GetMediaAsync(Guid id, CancellationToken cancellationToken)
    • The media with the given id, or null.
  • Task<MediaInfo> AddAsync(Guid gameId, MediaInfo media, Stream file, CancellationToken cancellationToken)
    • Adds media to a game from a stream, which is read to the end.
  • Task<MediaInfo> AddFromUrlAsync(Guid gameId, MediaInfo media, string url, CancellationToken cancellationToken)
    • Adds media to a game, downloading the file from a URL.
  • Task<MediaInfo> UpdateAsync(MediaInfo media, CancellationToken cancellationToken)
    • Writes the name, type, source URL, MIME type and sort order of media. The file is untouched.
  • Task<MediaInfo> ReplaceFileAsync(Guid id, Stream file, CancellationToken cancellationToken)
    • Replaces the file of existing media.
  • Task<Stream> OpenReadAsync(Guid id, CancellationToken cancellationToken)
    • Opens the media's file for reading, or returns null when there is no such media or file.
  • Task DeleteAsync(Guid id, CancellationToken cancellationToken)
    • Deletes media and its file. Does nothing when there is no such media.

IMetadataLookup​

interface — LANCommander.Server.Plugins.IMetadataLookup

Looks up game metadata through the server's configured providers. Provided by the server; inject it into a scoped plugin service or page. Lookups do not import or change games.

Methods

  • IReadOnlyList<string> GetProviderNames()
    • The names of available providers, ordered case-insensitively.
  • Task<MetadataSearchPage> SearchGamesAsync(string providerName, string input, int limit, int offset, CancellationToken cancellationToken)
    • Searches a configured, available provider.
  • Task<Game> GetGameAsync(string providerName, string gameId, CancellationToken cancellationToken)
    • Fetches full metadata by the provider's game id, or null when it has no such game.

IMetadataProviderExtension​

interface — LANCommander.Server.Plugins.IMetadataProviderExtension

Adds a source of game metadata, alongside the built-in ones such as HQ, IGDB and PCGamingWiki. Administrators pick it when looking up a game, the launcher's packaging wizard lists it, and IMetadataLookup searches it. Register an implementation in IPlugin.ConfigureServices.

Properties

  • string Name { get; }
    • The name the source is shown and chosen by. Must be unique among the server's metadata providers; a plugin source named like a built-in one is ignored.
  • bool IsAvailable { get; }
    • Whether the source can be used right now, e.g. false until it has been given an API key. Unavailable sources aren't listed. Read each time the providers are listed, so keep it cheap.

Methods

  • Task<MetadataSearchPage> SearchGamesAsync(string input, string subProvider, int limit, int offset, CancellationToken cancellationToken)
    • Searches the source for games. A failure is shown to the administrator searching.
  • Task<Game> GetGameAsync(string gameId, CancellationToken cancellationToken)
    • Fetches a game's full metadata by the id a search returned, or null if the source has no such game.
  • Task<IReadOnlyList<MetadataSubProviderInfo>> GetSubProvidersAsync(CancellationToken cancellationToken)
    • Parts of the source a search can be narrowed to, e.g. the services an aggregator draws on. Empty when there are none.
  • Task<MetadataGame> ResolveByExternalIdAsync(string provider, string externalId, CancellationToken cancellationToken)
    • Finds the game a game's id on another service (its external id, e.g. a Steam AppID) refers to, so a game that already has one is matched exactly instead of by title. Null when the source can't, and the server falls back to searching.

IMultiplayerModeProvider​

interface — LANCommander.Server.Plugins.IMultiplayerModeProvider

Manages the multiplayer modes of games. Provided by the server; inject it into a scoped plugin service or page.

IOwnedRecordProvider<TInfo>​

interface — LANCommander.Server.Plugins.IOwnedRecordProvider<TInfo>

Lists and manages records that belong to a game, redistributable, tool or server: actions, scripts, save paths and the like. Each provider accepts only the owners its records can have, and throws ArgumentException for any other.

Methods

  • Task<IReadOnlyList<TInfo>> GetAsync(RecordOwner owner, CancellationToken cancellationToken)
    • The owner's records. For a game's version-scoped records, those of the version the owner names, or of the latest version.
  • Task<TInfo> GetRecordAsync(Guid id, CancellationToken cancellationToken)
    • The record with the given id, or null.
  • Task<TInfo> AddAsync(RecordOwner owner, TInfo record, CancellationToken cancellationToken)
    • Adds a record to an owner. For a game's version-scoped records, to the version the owner names, or to the latest version.
  • Task<TInfo> UpdateAsync(TInfo record, CancellationToken cancellationToken)
    • Writes every field of a record. It stays with its owner.
  • Task DeleteAsync(Guid id, CancellationToken cancellationToken)
    • Deletes a record. Does nothing when there is no such record.

IPackageExporter​

interface — LANCommander.Server.Plugins.IPackageExporter

Exports games, redistributables, servers and tools as LCX packages through the server's own export pipeline, the same one the export dialog uses. Provided by the server; inject it into a scoped plugin service or page.

Methods

  • Task<PackageContents> DescribeAsync(ImportExportRecordType recordType, Guid recordId, CancellationToken cancellationToken)
    • Describes what a package of the record would hold: the record itself and every child record the export dialog would offer, such as archives, media, scripts and keys. Nothing is written.
  • Task ExportAsync(ImportExportRecordType recordType, Guid recordId, Stream output, IEnumerable<Guid> excludedItemIds, CancellationToken cancellationToken)
    • Writes an LCX package of the record to a stream, with every child record except those excluded.

IPackageImporter​

interface — LANCommander.Server.Plugins.IPackageImporter

Imports LCX packages through the server's own import pipeline, the same one the import API and the import dialog use. Provided by the server; inject it into a scoped plugin service or page.

Methods

  • Task<PackageImportResult> ImportFileAsync(string packagePath, Guid? storageLocationId, ManifestType? manifestType, CancellationToken cancellationToken)
    • Imports every record in an LCX file the server can already read.
  • Task<PackageImportResult> ImportStreamAsync(Stream package, Guid? storageLocationId, ManifestType? manifestType, IProgress<long> copyProgress, CancellationToken cancellationToken)
    • Copies an LCX package stream to the server's temporary storage, then imports every record in it.

IPluginSettingsExtension​

interface — LANCommander.Server.Plugins.IPluginSettingsExtension

Links a plugin's settings page from its row on Settings → Plugins, under the row's menu. Use it for settings too small to deserve an entry in the server's navigation; a plugin with pages of its own registers an IServerNavigationExtension instead. Register an implementation in IPlugin.ConfigureServices.

Properties

  • string Href { get; }
    • Plugin application route of the settings page, beginning with /Plugins/.

IRecurringJobHandler​

interface — LANCommander.Server.Plugins.IRecurringJobHandler

Does the work of recurring jobs added through IRecurringJobScheduler. Register an implementation in IPlugin.ConfigureServices; it's resolved from a fresh scope for every run.

Properties

  • string Name { get; }
    • Identifies the handler to AddOrUpdate; start it with the plugin's id.

Methods

  • Task ExecuteAsync(string argument, CancellationToken cancellationToken)
    • Runs the job.

IRecurringJobScheduler​

interface — LANCommander.Server.Plugins.IRecurringJobScheduler

Runs plugin work on a cron schedule through the server's background job processor, alongside the server's own recurring jobs and on its dashboard. Provided by the server; inject it anywhere, it's a singleton.

Methods

  • void AddOrUpdate(string jobId, string handler, string argument, string cronExpression, TimeZoneInfo timeZone)
    • Adds a recurring job, or changes the one with the same id.
  • void Remove(string jobId)
    • Removes a recurring job. Does nothing when there's no such job.
  • void Trigger(string jobId)
    • Runs a recurring job now, outside its schedule. Does nothing when there's no such job.
  • RecurringJobInfo Get(string jobId)
    • The plugin recurring job with the given id, or null.
  • bool IsValidCronExpression(string cronExpression)
    • Whether cronExpression is one AddOrUpdate accepts.

IRedistributableProvider​

interface — LANCommander.Server.Plugins.IRedistributableProvider

Lists and manages the server's redistributables. Provided by the server; inject it into a scoped plugin service or page. Their archives arrive through IPackageImporter, and their scripts are managed through IScriptProvider.

Methods

  • Task<IReadOnlyList<RedistributableInfo>> GetAsync(CancellationToken cancellationToken)
    • Every redistributable, ordered by name.
  • Task<RedistributableInfo> GetAsync(Guid id, CancellationToken cancellationToken)
    • The redistributable with the given id, or null.
  • Task<RedistributableInfo> FindAsync(string name, CancellationToken cancellationToken)
    • The redistributable with the given name, compared case-insensitively, or null.
  • Task<RedistributableInfo> AddAsync(RedistributableInfo redistributable, CancellationToken cancellationToken)
  • Task<RedistributableInfo> UpdateAsync(RedistributableInfo redistributable, CancellationToken cancellationToken)
    • Writes every field of a redistributable.
  • Task DeleteAsync(Guid id, CancellationToken cancellationToken)
    • Deletes a redistributable along with its archives, files included, unlinking it from every game. Does nothing when there is no such redistributable.

ISavePathProvider​

interface — LANCommander.Server.Plugins.ISavePathProvider

Manages the save paths of games, per version. Provided by the server; inject it into a scoped plugin service or page.

IScriptProvider​

interface — LANCommander.Server.Plugins.IScriptProvider

Manages the scripts of games (per version), redistributables, tools and servers. Provided by the server; inject it into a scoped plugin service or page.

IServerDockExtension​

interface — LANCommander.Server.Plugins.IServerDockExtension

Docks a bar along the top or bottom edge of the server's interface, on every page that has the navigation, e.g. an alert banner or a status bar. Register an implementation in IPlugin.ConfigureServices; any number of plugins may.

Properties

  • string Id { get; }
    • Identifies the bar, and orders bars with the same Order: letters, digits, ., - and _, e.g. com.mycompany.myplugin.player. Bars that share an id with another aren't shown.
  • ServerDockPosition Position { get; }
    • The edge the bar is docked to.
  • Type Component { get; }
    • The Razor component rendered as the bar. It takes no parameters.
  • int Order { get; }
    • Orders bars on the same edge; lower values sit nearer the edge.
  • PluginAccessPolicy Access { get; }
    • Who sees the bar. Defaults to administrators only; use AuthenticatedUser for a bar every signed-in user gets.

IServerEndpointExtension​

interface — LANCommander.Server.Plugins.IServerEndpointExtension

Contributes HTTP endpoints to the server's API, for example for a launcher or another client to call. Register an implementation in IPlugin.ConfigureServices.

Properties

  • string RoutePrefix { get; }
    • The path segment the endpoints are mapped under: /api/Plugins/{RoutePrefix}. Letters, digits, ., - and _, starting with a letter or digit. Must be unique among plugins, ignoring case; extensions that share a prefix are all ignored.
  • PluginAccessPolicy Access { get; }
    • Who may call the endpoints. Defaults to administrators only.

Methods

  • void MapEndpoints(IEndpointRouteBuilder endpoints)
    • Maps the endpoints. endpoints is already rooted at /api/Plugins/{RoutePrefix} and carries the Access requirement, so routes are given relative to it. Called once, when the server starts.

IServerEngineExtension​

interface — LANCommander.Server.Plugins.IServerEngineExtension

Runs game servers somewhere other than as a process on the LANCommander server's machine, such as in a container. Each engine is offered on a server's General page alongside the built-in Local and Remote engines, and may be configured on Settings › Servers through its SettingsComponent. Register an implementation in IPlugin.ConfigureServices.

Properties

  • string Id { get; }
    • Identifies the engine. Stored with every server that uses it, so it must never change, e.g. com.mycompany.myplugin.engine.
  • string Name { get; }
    • The engine's name, as offered on a server's General page.
  • ServerEngineFeatures Features { get; }
    • What the engine can do beyond starting and stopping a server.
  • Type EditorComponent { get; }
    • A Razor component shown on a server's General page while the engine is selected, in place of the Local engine's executable, arguments and process options. It takes a ServerEngineEditorContext as its Context parameter, and is saved with the rest of the page. Null shows nothing.
  • Type SettingsComponent { get; }
    • A Razor component listed under the engine's name with the built-in engines on the server's Settings › Servers page, configuring the engine itself rather than any one server, e.g. the hosts it runs servers on. It takes a ServerEngineSettingsContext as its Context parameter, keeps its configuration wherever the plugin does, such as in IPluginSettings<T>, and saves it when the page is saved by registering with OnSave. The engine is also listed in the page's Add menu with the built-in engines; register with OnAdd to act on being chosen there. Null leaves the engine off the page.
  • IReadOnlyList<ServerEngineSection> Sections { get; }
    • Further pages of a server's editor, listed under the engine's name in its menu once the server has been saved with this engine.

Methods

  • Task InitializeAsync(IServerEngineHost host, CancellationToken cancellationToken)
    • Called once, when the server starts, before any other call. host is how the engine reports what its servers do; keep it.
  • Task ServersChangedAsync(IReadOnlyList<ServerEngineServer> servers, CancellationToken cancellationToken)
    • Called with every server using the engine when the engine is initialized and whenever one is added, changed or deleted, e.g. to follow the output of those that are running.
  • Task StartAsync(ServerEngineServer server, CancellationToken cancellationToken)
    • Starts a server, returning once it has started rather than when it stops. Throw to report that it could not be started; the server shows the message.
  • Task StopAsync(ServerEngineServer server, CancellationToken cancellationToken)
    • Stops a server, returning once it has stopped.
  • Task<ServerEngineStatus> GetStatusAsync(ServerEngineServer server, CancellationToken cancellationToken)
    • Whether a server is running. Called every couple of seconds while anyone is looking at the server, so it should be cheap.
  • Task<ServerEngineProcessInfo> GetProcessInfoAsync(ServerEngineServer server, CancellationToken cancellationToken)
    • Samples a running server's usage, for ProcessInfo. Null when it isn't running or can't be sampled.
  • bool CanSendInput(ServerEngineServer server)
    • Whether SendInputAsync can deliver a line to the server now, for Input.
  • Task<bool> SendInputAsync(ServerEngineServer server, string line, CancellationToken cancellationToken)
    • Writes a line to the server's input. Returns false if that isn't possible.
  • IReadOnlyList<ServerEngineConsole> GetConsoles(ServerEngineServer server)
    • The consoles the engine offers for a server, for Consoles, e.g. its log and a shell. Called whenever the server's pages are drawn, so it should be cheap and shouldn't reach out to anything; work it out from the server's settings. A console that can't be opened right now, e.g. because the server isn't running, should still be listed, and fail to open with a message saying why.
  • IAsyncEnumerable<ServerEngineLogLine> ReadLogAsync(ServerEngineServer server, string consoleId, ServerEngineLogRequest request, CancellationToken cancellationToken)
    • Reads one of the server's Log consoles, oldest line first. Throw to report that it can't be read; the server shows the message.
  • Task<IServerEngineTerminal> OpenTerminalAsync(ServerEngineServer server, string consoleId, ServerEngineTerminalSize size, CancellationToken cancellationToken)
    • Opens one of the server's Terminal consoles at the administrator's terminal's size. Throw to report that it can't be opened; the server shows the message.
  • Task<IReadOnlyList<ServerEngineFile>> ListFilesAsync(ServerEngineServer server, string path, CancellationToken cancellationToken)
    • Lists a folder of the server's files, for Files. Throw DirectoryNotFoundException when there is no such folder.
  • Task<Stream> OpenFileAsync(ServerEngineServer server, string path, CancellationToken cancellationToken)
    • Opens one of the server's files to read. The host or calling plugin disposes the stream, which may be nonseekable. Throw FileNotFoundException when there is no such file.
  • Task WriteFileAsync(ServerEngineServer server, string path, Stream content, CancellationToken cancellationToken)
    • Writes one of the server's files from content, replacing it if it exists and creating any folders it is in that don't. Read from its current position without seeking or disposing it; the caller owns the stream. Cancellation may leave a partial file.
  • Task DeleteFileAsync(ServerEngineServer server, string path, CancellationToken cancellationToken)
    • Deletes one of the server's files, or a folder and everything in it.
  • Task CreateDirectoryAsync(ServerEngineServer server, string path, CancellationToken cancellationToken)
    • Creates a folder among the server's files, and any it is in that don't exist.

IServerEngineHost​

interface — LANCommander.Server.Plugins.IServerEngineHost

How an IServerEngineExtension reports what its servers do. Thread safe.

Methods

  • void ReportStatus(Guid serverId, ServerEngineStatus status, string error)
    • Reports that a server's status changed on its own, e.g. it exited, so those watching it see so at once rather than at their next look. Changes made through the engine's own methods needn't be reported.
  • void WriteOutput(Guid serverId, string line)
    • Reports a line of a server's output, for Output.
  • void ReportAddress(Guid serverId, string host, int? port)
    • Reports where players connect to a server, for Address. Players are sent it in place of whichever of the server's Host and Port the administrator left blank; those they set override it. It is kept only while the LANCommander server runs, so report it whenever it may have changed and for servers already running when ServersChangedAsync is first called. Reporting the same address again does nothing.

IServerEngineTerminal​

interface — LANCommander.Server.Plugins.IServerEngineTerminal

An open Terminal console. The server reads it and writes to it at the same time, from different threads; it is disposed when the administrator leaves the page, which should end the session.

Methods

  • ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken)
    • Reads what the terminal writes, as UTF-8 that may split a character across reads. Returns 0 once the session has ended, e.g. the shell exited.
  • ValueTask WriteAsync(ReadOnlyMemory<byte> input, CancellationToken cancellationToken)
    • Writes what the administrator typed or pasted, as UTF-8, escape sequences included.
  • Task ResizeAsync(ServerEngineTerminalSize size, CancellationToken cancellationToken)
    • The administrator's terminal changed size. Engines that can't resize a session after opening it can ignore this.

IServerNavigationExtension​

interface — LANCommander.Server.Plugins.IServerNavigationExtension

Contributes a link to the server's primary navigation. Register an implementation in IPlugin.ConfigureServices, once per link; a plugin may register any number, and ServerNavigationLink saves writing a class for each. Links can be gathered under an expandable IServerNavigationGroupExtension.

Properties

  • string Id { get; }
    • Stable identifier used to detect duplicate contributions.
  • string Label { get; }
    • Text displayed in the server navigation.
  • string Href { get; }
    • Plugin application route, beginning with /Plugins/.
  • string Icon { get; }
    • Optional LANCommander icon name.
  • string Section { get; }
    • The section the entry is placed in: one of ServerNavigationSection, or the Id of a plugin group. Null places it in the plugin area at the end of the navigation.
  • string After { get; }
    • The built-in entry in Section this entry follows: a link's route, e.g. /Settings/Users, or a group's ServerNavigationSection. Use Start to place it first; null, or an entry the section does not show, places it last.
  • int Order { get; }
    • Orders entries placed at the same spot; ties are sorted by label.
  • PluginAccessPolicy Access { get; }
    • Who may see this entry. Defaults to administrators only.

IServerNavigationGroupExtension​

interface — LANCommander.Server.Plugins.IServerNavigationGroupExtension

Contributes an expandable group to the server's navigation, like Dashboards or Settings. Entries, and other groups, are placed in it by naming its Id as their section. Register an implementation in IPlugin.ConfigureServices.

Properties

  • string Id { get; }
    • Stable identifier. Entries placed in the group name it as their Section, and nested groups as their Section. It cannot be one of the ServerNavigationSection values, nor the id of a navigation entry.
  • string Label { get; }
    • Text displayed as the group's title.
  • string Icon { get; }
    • Optional LANCommander icon name.
  • string Section { get; }
    • The section the group is placed in: one of ServerNavigationSection, except Profile, or the Id of another plugin group to nest it. Null places it in the plugin area at the end of the navigation.
  • string After { get; }
    • The built-in entry in Section this group follows, as for After.
  • int Order { get; }
    • Orders entries and groups placed at the same spot; ties are sorted by label.
  • PluginAccessPolicy Access { get; }
    • Who may see this group, and so any of its entries. Defaults to administrators only.

IServerProvider​

interface — LANCommander.Server.Plugins.IServerProvider

Lists and manages the server's game servers, with their consoles and HTTP paths. Provided by the server; inject it into a scoped plugin service or page. Their actions and scripts are managed through IActionProvider and IScriptProvider. Like the other record providers, this is a trusted host service, not an authorization boundary: plugins must protect their pages and endpoints with the appropriate access policy.

Methods

  • Task<IReadOnlyList<ServerFileInfo>> ListFilesAsync(Guid serverId, string relativePath, CancellationToken cancellationToken)
    • Lists one folder through the server's selected host engine. An empty path lists the engine's file root (the working directory for local servers). Paths are relative, not machine paths; absolute paths, traversal and malformed names are rejected. No engine failure becomes an empty list.
  • Task<Stream> OpenFileAsync(Guid serverId, string relativePath, CancellationToken cancellationToken)
    • Opens a file through the selected host engine, using the same relative paths and errors as ListFilesAsync. The caller owns and must dispose the returned stream before its plugin scope ends. It may be nonseekable; pass cancellation to subsequent reads as well.
  • Task WriteFileAsync(Guid serverId, string relativePath, Stream content, CancellationToken cancellationToken)
    • Writes a file through the selected host engine, replacing it and creating parent folders. Uses the same relative paths and errors as ListFilesAsync. Reads content from its current position to the end without seeking or disposing it; the caller retains ownership. Cancellation or failure may leave a partial file; writes are not atomic.
  • Task<IReadOnlyList<ServerInfo>> GetAsync(CancellationToken cancellationToken)
    • Every game server, ordered by name.
  • Task<ServerInfo> GetAsync(Guid id, CancellationToken cancellationToken)
    • The game server with the given id, or null.
  • Task<ServerInfo> AddAsync(ServerInfo server, CancellationToken cancellationToken)
  • Task<ServerInfo> UpdateAsync(ServerInfo server, CancellationToken cancellationToken)
    • Writes every field of a game server.
  • Task DeleteAsync(Guid id, CancellationToken cancellationToken)
    • Deletes a game server. Does nothing when there is no such game server.
  • Task<IReadOnlyList<ServerConsoleInfo>> GetConsolesAsync(Guid serverId, CancellationToken cancellationToken)
  • Task<ServerConsoleInfo> AddConsoleAsync(Guid serverId, ServerConsoleInfo console, CancellationToken cancellationToken)
  • Task<ServerConsoleInfo> UpdateConsoleAsync(ServerConsoleInfo console, CancellationToken cancellationToken)
  • Task DeleteConsoleAsync(Guid id, CancellationToken cancellationToken)
    • Deletes a console. Does nothing when there is no such console.
  • Task<IReadOnlyList<ServerHttpPathInfo>> GetHttpPathsAsync(Guid serverId, CancellationToken cancellationToken)
  • Task<ServerHttpPathInfo> AddHttpPathAsync(Guid serverId, ServerHttpPathInfo httpPath, CancellationToken cancellationToken)
  • Task<ServerHttpPathInfo> UpdateHttpPathAsync(ServerHttpPathInfo httpPath, CancellationToken cancellationToken)
  • Task DeleteHttpPathAsync(Guid id, CancellationToken cancellationToken)
    • Deletes an HTTP path. Does nothing when there is no such HTTP path.

IServerRouteAssemblyExtension​

interface — LANCommander.Server.Plugins.IServerRouteAssemblyExtension

Contributes an assembly containing routable Razor components to the server. Register an implementation in IPlugin.ConfigureServices.

Properties

  • Assembly Assembly { get; }
    • The assembly containing the plugin's routable components.

IServerSectionExtension​

interface — LANCommander.Server.Plugins.IServerSectionExtension

Adds pages, and a summary at the top of the General page, to game servers added on the server, whatever runs them, e.g. a page of a game's live players or its mod configuration. Register an implementation in IPlugin.ConfigureServices; any number of plugins may.

Properties

  • string Id { get; }
    • Identifies the extension. Part of its pages' addresses, so keep it stable: letters, digits, ., - and _, e.g. com.mycompany.myplugin.servers.
  • string Name { get; }
    • The name its pages are listed under in a server's menu.

Methods

  • IReadOnlyList<ServerSection> GetSections(ServerInfo server)
    • The pages to add to a server, e.g. only to the servers of games the plugin knows. None by default.
  • Type GetOverview(ServerInfo server)
    • A Razor component shown at the top of a server's General page, above the server's settings, e.g. a summary of its state. Null shows nothing. Overviews of several plugins are shown in the order of their names.

IServerSourceExtension​

interface — LANCommander.Server.Plugins.IServerSourceExtension

Lists game servers that live somewhere other than the server's database, e.g. those another system already manages, so they appear on the Servers page beside the ones administrators add. Register an implementation in IPlugin.ConfigureServices.

Properties

  • string Id { get; }
    • Identifies the source. Part of every one of its servers' ids, so it must never change, e.g. com.mycompany.myplugin.servers.
  • string Name { get; }
    • The source's name, shown beside its servers on the Servers page.
  • TimeSpan RefreshInterval { get; }
    • How often GetServersAsync is called. Ask for a refresh sooner with Refresh. At least a second.

Methods

  • Task InitializeAsync(IServerSourceHost host, CancellationToken cancellationToken)
    • Called once, when the server starts, before any other call. host is how the source reports changes between refreshes; keep it.
  • Task<IReadOnlyList<ExternalServer>> GetServersAsync(CancellationToken cancellationToken)
    • Lists the source's servers as they are now, status included. Called every RefreshInterval, so it should be reasonably cheap. Throw when the list can't be read, e.g. a host is unreachable: the servers last listed are kept, marked as errored, until a list is read again. Servers with no key, or one another server already has, are left out.
  • Task StartAsync(ExternalServer server, CancellationToken cancellationToken)
    • Starts a server whose CanStart is set, returning once it has been asked to rather than when it stops. Throw to report that it could not be started; the server shows the message. The list is refreshed soon after.
  • Task StopAsync(ExternalServer server, CancellationToken cancellationToken)
    • Stops a server whose CanStop is set. Throw to report that it could not be stopped. The list is refreshed soon after.
  • IReadOnlyList<ExternalServerSection> GetSections(ExternalServer server)
    • Pages of the source's own for a server, listed under the source's name in the server's menu beside its General and Monitor pages, e.g. its players or its configuration on the system it comes from. Called whenever the server's pages are drawn, so it should be cheap and shouldn't reach out to anything; work it out from the server as listed. Register the components' assembly with IServerRouteAssemblyExtension only if they are also pages of their own.
  • Type GetOverview(ExternalServer server)
    • A Razor component of the source's own shown at the top of a server's General page, above what the server shows of every listed server, e.g. a summary from the system it comes from. It takes the ExternalServer as its Server parameter, refreshed as the source lists it again, and the id the server knows it by as its ServerId parameter. Called whenever the page is drawn, so it should be cheap. Null shows nothing.
  • IAsyncEnumerable<ServerEngineLogLine> ReadLogAsync(ExternalServer server, ServerEngineLogRequest request, CancellationToken cancellationToken)
    • Reads the output of a server with Log, oldest line first, for its Monitor page: the latest Tail lines, then, when Follow is set, lines as they are written until the reader cancels. Throw to report that it can't be read; the page shows the message.
  • Task<ServerEngineProcessInfo> GetProcessInfoAsync(ExternalServer server, CancellationToken cancellationToken)
    • Samples a running server with ProcessInfo, every couple of seconds while its Monitor page is open. Null when it can't be sampled.
  • Task<string> SendCommandAsync(ExternalServer server, string command, CancellationToken cancellationToken)
    • Sends a command to a running server with Commands, from its Monitor page, e.g. a line to its console. Returns what the server answered where it answers directly (as over RCON), or null where its answer appears in its output. Throw to report that the command couldn't be sent; the page shows the message.

IServerSourceHost​

interface — LANCommander.Server.Plugins.IServerSourceHost

How an IServerSourceExtension reports changes between refreshes. Thread safe.

Methods

  • void Refresh()
    • Asks for the source's servers to be listed again now, e.g. because one was added.
  • void ReportStatus(string key, ServerEngineStatus status, string error)
    • Reports that a listed server's status changed, so those watching it see so at once rather than at the next refresh. Does nothing for a key that wasn't listed.

IStorageLocationProvider​

interface — LANCommander.Server.Plugins.IStorageLocationProvider

Lists the server's storage locations, for example to let an administrator pick where an import writes its archives. Provided by the server; inject it into a scoped plugin service or page.

Methods

  • Task<IReadOnlyList<StorageLocationInfo>> GetAsync(StorageLocationType type, CancellationToken cancellationToken)
    • The storage locations of the given type, the default first.

ITaxonomyProvider​

interface — LANCommander.Server.Plugins.ITaxonomyProvider

Lists and manages the server's taxonomy records: categories, collections, companies, engines, genres, platforms and tags. Provided by the server; inject it into a scoped plugin service or page. Games are linked to them through IGameProvider.

Methods

  • Task<IReadOnlyList<TaxonomyInfo>> GetAsync(TaxonomyKind kind, CancellationToken cancellationToken)
    • Every record of a kind, ordered by name.
  • Task<TaxonomyInfo> GetAsync(TaxonomyKind kind, Guid id, CancellationToken cancellationToken)
    • The record with the given id, or null.
  • Task<TaxonomyInfo> FindAsync(TaxonomyKind kind, string name, CancellationToken cancellationToken)
    • The record with the given name, compared case-insensitively, or null.
  • Task<TaxonomyInfo> GetOrAddAsync(TaxonomyKind kind, string name, CancellationToken cancellationToken)
    • The record with the given name, added first when there is none.
  • Task<TaxonomyInfo> AddAsync(TaxonomyKind kind, string name, CancellationToken cancellationToken)
    • Adds a record, even when one with the same name exists.
  • Task<TaxonomyInfo> RenameAsync(TaxonomyKind kind, Guid id, string name, CancellationToken cancellationToken)
  • Task DeleteAsync(TaxonomyKind kind, Guid id, CancellationToken cancellationToken)
    • Deletes a record, unlinking it from every game. Does nothing when there is no such record.

IToolProvider​

interface — LANCommander.Server.Plugins.IToolProvider

Lists and manages the server's tools. Provided by the server; inject it into a scoped plugin service or page. Their archives arrive through IPackageImporter, and their actions and scripts are managed through IActionProvider and IScriptProvider. The games a tool is linked to can be set from either side; see Tools.

Methods

  • Task<IReadOnlyList<ToolInfo>> GetAsync(CancellationToken cancellationToken)
    • Every tool, ordered by name.
  • Task<ToolInfo> GetAsync(Guid id, CancellationToken cancellationToken)
    • The tool with the given id, or null.
  • Task<ToolInfo> FindAsync(string name, CancellationToken cancellationToken)
    • The tool with the given name, compared case-insensitively, or null.
  • Task<ToolInfo> AddAsync(ToolInfo tool, CancellationToken cancellationToken)
  • Task<ToolInfo> UpdateAsync(ToolInfo tool, CancellationToken cancellationToken)
    • Writes every field of a tool.
  • Task DeleteAsync(Guid id, CancellationToken cancellationToken)
    • Deletes a tool along with its archives, files included, unlinking it from every game. Does nothing when there is no such tool.
  • Task<IReadOnlyList<Guid>> GetGamesAsync(Guid toolId, CancellationToken cancellationToken)
    • The ids of the games a tool is linked to.
  • Task SetGamesAsync(Guid toolId, IEnumerable<Guid> gameIds, CancellationToken cancellationToken)
    • Replaces the games a tool is linked to. An empty list unlinks them all.

IUserDirectory​

interface — LANCommander.Server.Plugins.IUserDirectory

Reads the server's user accounts, for example to let users sign in to something the plugin hosts with their LANCommander account. Provided by the server; inject it into a scoped plugin service or page.

Methods

  • Task<IReadOnlyList<UserAccount>> GetAsync(CancellationToken cancellationToken)
    • Every account on the server, ordered by user name.
  • Task<UserAccount> GetAsync(Guid id, CancellationToken cancellationToken)
    • The account with the given id, or null.
  • Task<UserAccount> FindAsync(string userName, CancellationToken cancellationToken)
    • The account with the given user name, compared case-insensitively, or null.
  • Task<PasswordCheckResult> CheckPasswordAsync(string userName, string password, CancellationToken cancellationToken)
    • Checks a user's LANCommander password, for plugins that use the server as their authentication store. Only a Succeeded result means the user is authenticated; the result then carries their account.

ActionInfo​

record — LANCommander.Server.Plugins.ActionInfo

Something a launcher can run for a game, tool or server, such as starting it.

Properties

  • Guid Id { get; init; }
  • string Name { get; init; }
  • string Path { get; init; }
    • The executable, usually relative to {InstallDir}.
  • string Arguments { get; init; }
  • string WorkingDirectory { get; init; }
  • ActionType Type { get; init; }
    • What the action is for, which decides where a launcher offers it.
  • bool IsPrimary { get; init; }
    • Whether this is the action a launcher runs when asked to play.
  • int SortOrder { get; init; }
  • RuntimePlatform Platforms { get; init; }
    • The platforms the action runs on.
  • string OptionOverrides { get; init; }
    • Install option values the action overrides, as JSON.
  • RecordOwner Owner { get; init; }
    • Set by the server; ignored when writing.

ArchiveInfo​

record — LANCommander.Server.Plugins.ArchiveInfo

An archive of files for a game, redistributable or tool.

Properties

  • Guid Id { get; init; }
  • string Version { get; init; }
  • Guid StorageLocationId { get; init; }
  • Guid? GameId { get; init; }
  • Guid? GameVersionId { get; init; }
  • Guid? RedistributableId { get; init; }
  • Guid? ToolId { get; init; }
  • long CompressedSize { get; init; }
  • long UncompressedSize { get; init; }
  • DateTime CreatedOn { get; init; }

ArchiveUploadedEvent​

record — LANCommander.Server.Plugins.ArchiveUploadedEvent

Raised after an uploaded archive is stored and linked to what it belongs to, and for a game, to its version. Exactly one of GameId, RedistributableId and ToolId is set. Archives an import or packaging creates don't raise it.

Properties

  • Guid ArchiveId { get; init; }
  • Guid? GameId { get; init; }
  • Guid? GameVersionId { get; init; }
  • Guid? RedistributableId { get; init; }
  • Guid? ToolId { get; init; }
  • string Version { get; init; }

ExternalServer​

record — LANCommander.Server.Plugins.ExternalServer

A game server listed by an IServerSourceExtension.

Properties

  • string Key { get; init; }
    • Identifies the server among the source's, and must stay the same for as long as it is the same server, e.g. its id where the source got it from. Case sensitive.
  • string Name { get; init; }
  • Guid? GameId { get; init; }
    • The game the server is for, when it is one of this server's games; a game that doesn't exist here is ignored.
  • string Host { get; init; }
    • The host name or IP address players connect to; empty for the LANCommander server's own address.
  • int Port { get; init; }
    • The port players connect to; 0 when there isn't one.
  • ServerEngineStatus Status { get; init; }
  • string StatusMessage { get; init; }
    • Why the server is in Error, where the source knows.
  • string Location { get; init; }
    • Where the server runs, shown beside it, e.g. the host it is on. Optional.
  • string ManageUrl { get; init; }
    • Where an administrator manages the server, such as a page of the plugin's or another system's page for it: an absolute URL, or a path on this server. The server's Edit button opens it; null leaves the server without one.
  • bool CanStart { get; init; }
    • Whether administrators may start the server through StartAsync.
  • bool CanStop { get; init; }
    • Whether administrators may stop the server through StopAsync.
  • ExternalServerFeatures Features { get; init; }
    • What its Monitor page can show and do beyond its status.

ExternalServerIds​

class — LANCommander.Server.Plugins.ExternalServerIds

Works out the ids of servers listed by an IServerSourceExtension.

Methods

  • Guid Create(string sourceId, string key)
    • The id the server knows a listed server by: the same for the same source id (ignoring case) and key, and different for any other.

ExternalServerSection​

record — LANCommander.Server.Plugins.ExternalServerSection

A page an IServerSourceExtension adds to one of its servers.

Properties

  • string Slug { get; init; }
    • The page's address under the server, /Servers/External/{id}/Source/{Slug}: letters, digits and -, unique among the server's pages.
  • string Title { get; init; }
    • The page's name in the menu and its title.
  • Type Component { get; init; }
    • A Razor component rendered as the page, taking the ExternalServer as its Server parameter, refreshed as the source lists it again, and the id the server knows it by as its ServerId parameter.

GameCreatedEvent​

record — LANCommander.Server.Plugins.GameCreatedEvent

Raised after a game or add-on is added, by hand, by an import or through IGameProvider.

Properties

  • Guid GameId { get; init; }
  • string Title { get; init; }

GameCustomFieldInfo​

record — LANCommander.Server.Plugins.GameCustomFieldInfo

A named value an administrator or plugin records against a game.

Properties

  • Guid Id { get; init; }
  • Guid GameId { get; init; }
  • string Name { get; init; }
  • string Value { get; init; }

GameDeletedEvent​

record — LANCommander.Server.Plugins.GameDeletedEvent

Raised after a game or add-on is deleted along with its archives and media.

Properties

  • Guid GameId { get; init; }
  • string Title { get; init; }

GameExternalIdInfo​

record — LANCommander.Server.Plugins.GameExternalIdInfo

An id a game goes by in another service, such as a store.

Properties

  • Guid Id { get; init; }
  • Guid GameId { get; init; }
  • string Provider { get; init; }
    • The service, e.g. Steam or GOG.
  • string ExternalId { get; init; }

GameInfo​

record — LANCommander.Server.Plugins.GameInfo

A game or add-on on the server: its own fields only. Its links, children and files are managed through the methods of IGameProvider and the other providers.

Properties

  • Guid Id { get; init; }
    • Empty when adding a game, to have the server choose one.
  • string Title { get; init; }
  • string SortTitle { get; init; }
  • string DirectoryName { get; init; }
  • string Description { get; init; }
  • string Notes { get; init; }
  • DateTime? ReleasedOn { get; init; }
  • GameType Type { get; init; }
    • A main game, or one of the kinds of add-on.
  • Guid? BaseGameId { get; init; }
    • For an add-on, the game it adds to.
  • GameInstallLocation InstallTo { get; init; }
  • bool ShowInLibrary { get; init; }
  • bool Singleplayer { get; init; }
  • bool Published { get; init; }
    • Whether launchers are offered the game.
  • KeyAllocationMethod KeyAllocationMethod { get; init; }
  • string ValidKeyRegex { get; init; }
  • Guid? EngineId { get; init; }
    • The game's engine, an Engine record.
  • DateTime CreatedOn { get; init; }
    • Set by the server; ignored when writing.
  • DateTime UpdatedOn { get; init; }
    • Set by the server; ignored when writing.

GameUpdatedEvent​

record — LANCommander.Server.Plugins.GameUpdatedEvent

Raised after a game or add-on is saved.

Properties

  • Guid GameId { get; init; }
  • string Title { get; init; }

GameVersionCreatedEvent​

record — LANCommander.Server.Plugins.GameVersionCreatedEvent

Raised after a game version is added, by an administrator, a plugin, or an upload that needed a version for its archive. Version can be empty for a placeholder version that an archive fills in later, which raises GameVersionUpdatedEvent.

Properties

  • Guid VersionId { get; init; }
  • Guid GameId { get; init; }
  • string Version { get; init; }
  • bool Published { get; init; }

GameVersionDeletedEvent​

record — LANCommander.Server.Plugins.GameVersionDeletedEvent

Raised after a game version is deleted.

Properties

  • Guid VersionId { get; init; }
  • Guid GameId { get; init; }
  • string Version { get; init; }

GameVersionInfo​

record — LANCommander.Server.Plugins.GameVersionInfo

A version of a game. Each version has its own archive, actions, scripts, save paths, option schema and redistributables; the latest one is what an edit to the game changes.

Properties

  • Guid Id { get; init; }
  • Guid GameId { get; init; }
  • string Version { get; init; }
    • The version number, e.g. 1.2.0.
  • string Changelog { get; init; }
  • int SortOrder { get; init; }
    • Position among the game's versions; the highest is the latest.
  • bool Published { get; init; }
    • Whether launchers are offered the version.
  • string OptionSchema { get; init; }
    • The options the version's install offers, as an option schema, or null.
  • Guid? ArchiveId { get; init; }
    • The version's archive, if it has one. Set by the server; ignored when writing.
  • DateTime CreatedOn { get; init; }
    • Set by the server; ignored when writing.

GameVersionPublishedChangedEvent​

record — LANCommander.Server.Plugins.GameVersionPublishedChangedEvent

Raised when a game version is published or unpublished. Launchers are offered a game's newest published version. Adding a version after an unpublished one publishes the earlier one, which raises this too.

Properties

  • Guid VersionId { get; init; }
  • Guid GameId { get; init; }
  • string Version { get; init; }
  • bool Published { get; init; }

GameVersionRedistributableInfo​

record — LANCommander.Server.Plugins.GameVersionRedistributableInfo

A redistributable required by a game version, with that version's option values as JSON.

Properties

  • RedistributableInfo Redistributable { get; init; }
  • string Options { get; init; }

GameVersionUpdatedEvent​

record — LANCommander.Server.Plugins.GameVersionUpdatedEvent

Raised after a game version is saved, or an archive is linked to it.

Properties

  • Guid VersionId { get; init; }
  • Guid GameId { get; init; }
  • string Version { get; init; }

IssueCreatedEvent​

record — LANCommander.Server.Plugins.IssueCreatedEvent

Raised after a user reports an issue with a game.

Properties

  • Guid IssueId { get; init; }
  • Guid GameId { get; init; }
  • Guid? ReportedByUserId { get; init; }
  • string Description { get; init; }

IssueResolvedEvent​

record — LANCommander.Server.Plugins.IssueResolvedEvent

Raised after an issue is marked resolved.

Properties

  • Guid IssueId { get; init; }
  • Guid GameId { get; init; }
  • Guid ResolvedByUserId { get; init; }

KeyAllocatedEvent​

record — LANCommander.Server.Plugins.KeyAllocatedEvent

Raised after a game key is allocated to a user or a machine, by a launcher requesting one or an administrator assigning it. A launcher swapping keys raises KeyReleasedEvent for the key it held first.

Properties

  • Guid KeyId { get; init; }
  • Guid GameId { get; init; }
  • KeyAllocationMethod Method { get; init; }
  • Guid? UserId { get; init; }
    • Set when Method is UserAccount.
  • string MacAddress { get; init; }
    • Set when Method is MacAddress.
  • int AvailableKeys { get; init; }
    • How many of the game's keys are still unallocated afterwards.

KeyInfo​

record — LANCommander.Server.Plugins.KeyInfo

A CD key for a game, handed out to players as the game's allocation method decides.

Properties

  • Guid Id { get; init; }
  • string Value { get; init; }
  • KeyAllocationMethod? AllocationMethod { get; init; }
    • How the key was claimed, or null while it is free. Set by the server; ignored when writing.
  • Guid? ClaimedByUserId { get; init; }
    • Set by the server; ignored when writing.
  • string ClaimedByMacAddress { get; init; }
    • Set by the server; ignored when writing.
  • string ClaimedByIpv4Address { get; init; }
    • Set by the server; ignored when writing.
  • string ClaimedByComputerName { get; init; }
    • Set by the server; ignored when writing.
  • DateTime? ClaimedOn { get; init; }
    • Set by the server; ignored when writing.
  • RecordOwner Owner { get; init; }
    • Set by the server; ignored when writing.

KeyReleasedEvent​

record — LANCommander.Server.Plugins.KeyReleasedEvent

Raised after a game key is released. The previous holder is given when there was one.

Properties

  • Guid KeyId { get; init; }
  • Guid GameId { get; init; }
  • Guid? UserId { get; init; }
  • string MacAddress { get; init; }
  • int AvailableKeys { get; init; }
    • How many of the game's keys are unallocated afterwards.

LibraryGameAddedEvent​

record — LANCommander.Server.Plugins.LibraryGameAddedEvent

Raised for each game added to a user's library. Adding an add-on adds its base game too, which raises its own event.

Properties

  • Guid UserId { get; init; }
  • Guid GameId { get; init; }

LibraryGameRemovedEvent​

record — LANCommander.Server.Plugins.LibraryGameRemovedEvent

Raised for each game removed from a user's library. Removing a game removes its hidden add-ons and any add-ons the user picked, which each raise their own event.

Properties

  • Guid UserId { get; init; }
  • Guid GameId { get; init; }

MatchCreatedEvent​

record — LANCommander.Server.Plugins.MatchCreatedEvent

Raised after a multiplayer match is first recorded, by a reporter or through IMatchStatisticsSink.

Properties

  • Guid MatchId { get; init; }
  • Guid GameId { get; init; }
  • Guid? ServerId { get; init; }
  • string Map { get; init; }
  • string Mode { get; init; }

MatchEndedEvent​

record — LANCommander.Server.Plugins.MatchEndedEvent

Raised after a match is ended with its results, or abandoned. Raised again if a reporter sends the results again, so handlers should replace rather than add.

Properties

  • Guid MatchId { get; init; }
  • Guid GameId { get; init; }
  • Guid? ServerId { get; init; }
  • MatchStatus Status { get; init; }
  • string Reason { get; init; }
  • IReadOnlyList<MatchResultInformation> Results { get; init; }
    • The final standings, best first. Empty for an abandoned match.

MatchEventsRecordedEvent​

record — LANCommander.Server.Plugins.MatchEventsRecordedEvent

Raised after a batch of a match's events is written. Batches are raised in order for each match, off the request that reported them; a slow handler delays later notifications but not writing.

Properties

  • Guid MatchId { get; init; }
  • Guid GameId { get; init; }
  • IReadOnlyList<MatchEventInformation> Events { get; init; }

MatchParticipantLinkedEvent​

record — LANCommander.Server.Plugins.MatchParticipantLinkedEvent

Raised when a match participant is linked to a LANCommander user.

Properties

  • Guid MatchId { get; init; }
  • Guid ParticipantId { get; init; }
  • string PlayerKey { get; init; }
  • Guid UserId { get; init; }
  • MatchParticipantLinkSource LinkSource { get; init; }

MediaCreatedEvent​

record — LANCommander.Server.Plugins.MediaCreatedEvent

Raised after a media item is added: a game's artwork, a user's avatar or an image on a page. Its file is written first when one is uploaded or downloaded with it.

Properties

  • Guid MediaId { get; init; }
  • Guid? GameId { get; init; }
    • The game the media belongs to, if any.
  • Guid? UserId { get; init; }
    • The user the media belongs to, such as for an avatar, if any.
  • MediaType Type { get; init; }

MediaDeletedEvent​

record — LANCommander.Server.Plugins.MediaDeletedEvent

Raised after a media item and its file are deleted, including when its game is.

Properties

  • Guid MediaId { get; init; }
  • Guid? GameId { get; init; }
  • Guid? UserId { get; init; }
  • MediaType Type { get; init; }

MediaGrabberItem​

record — LANCommander.Server.Plugins.MediaGrabberItem

One result of an IMediaGrabberExtension search.

Properties

  • string Id { get; init; }
    • Identifies the result within the source.
  • MediaType Type { get; init; }
    • The kind of media the result is.
  • string SourceUrl { get; init; }
    • Where the server downloads the media from.
  • string ThumbnailUrl { get; init; }
    • A preview to show in the search results; may be the same as SourceUrl.
  • string MimeType { get; init; }
    • The MIME type of the media at SourceUrl.
  • string Group { get; init; }
    • Results with the same group are shown together, e.g. under the game they belong to.
  • string Name { get; init; }
    • The result's own title where the source has one, e.g. a video's name.
  • TimeSpan? Duration { get; init; }
    • Running time, for videos.
  • string Resolution { get; init; }
    • A video's frame height as people say it ("1080p"), where the source knows it.

MediaInfo​

record — LANCommander.Server.Plugins.MediaInfo

An image, video or other file shown for a game, such as its cover or icon.

Properties

  • Guid Id { get; init; }
  • string Name { get; init; }
  • MediaType Type { get; init; }
  • string SourceUrl { get; init; }
    • Where the file came from, if anywhere.
  • string MimeType { get; init; }
  • int SortOrder { get; init; }
  • string Crc32 { get; init; }
    • The file's checksum. Set by the server; ignored when writing.
  • Guid StorageLocationId { get; init; }
    • Set by the server; ignored when writing.
  • Guid GameId { get; init; }
    • Set by the server; ignored when writing.

MediaUpdatedEvent​

record — LANCommander.Server.Plugins.MediaUpdatedEvent

Raised after a media item is saved, including when its file is replaced and when it is reordered among the game's media.

Properties

  • Guid MediaId { get; init; }
  • Guid? GameId { get; init; }
  • Guid? UserId { get; init; }
  • MediaType Type { get; init; }

MetadataGame​

record — LANCommander.Server.Plugins.MetadataGame

A game returned by one of the server's configured metadata providers.

Properties

  • string Id { get; init; }
    • The provider's game id, used to fetch the full metadata.
  • Game Data { get; init; }
    • The metadata supplied by the provider, not an imported server game.

MetadataSearchPage​

record — LANCommander.Server.Plugins.MetadataSearchPage

A page of metadata search results.

Properties

  • IReadOnlyList<MetadataGame> Results { get; init; }
  • bool More { get; init; }
  • int Limit { get; init; }
  • int Offset { get; init; }

MetadataSubProviderInfo​

record — LANCommander.Server.Plugins.MetadataSubProviderInfo

A part of an IMetadataProviderExtension a search can be narrowed to.

Properties

  • string Slug { get; init; }
    • Identifies it to SearchGamesAsync.
  • string Name { get; init; }
    • What administrators see.

MultiplayerModeInfo​

record — LANCommander.Server.Plugins.MultiplayerModeInfo

A way a game can be played with others.

Properties

  • Guid Id { get; init; }
  • MultiplayerType Type { get; init; }
  • NetworkProtocol NetworkProtocol { get; init; }
  • string Description { get; init; }
  • int MinPlayers { get; init; }
  • int MaxPlayers { get; init; }
  • int Spectators { get; init; }
  • RecordOwner Owner { get; init; }
    • Set by the server; ignored when writing.

PackageContents​

record — LANCommander.Server.Plugins.PackageContents

What a package of a record would hold, from DescribeAsync.

Properties

  • Guid RecordId { get; init; }
    • Id of the record.
  • ImportExportRecordType RecordType { get; init; }
    • The kind of record.
  • string Name { get; init; }
    • The record's title or name.
  • DateTime UpdatedOn { get; init; }
    • When the record itself was last changed.
  • IReadOnlyList<PackageItem> Items { get; init; }
    • The child records a package would carry.

PackageImportResult​

record — LANCommander.Server.Plugins.PackageImportResult

The outcome of an import run by IPackageImporter.

Properties

  • Guid RecordId { get; init; }
    • Id of the record the import created or updated.
  • ManifestType ManifestType { get; init; }
    • The kind of record the package held.
  • int ImportedCount { get; init; }
    • Number of records imported.

PackageItem​

record — LANCommander.Server.Plugins.PackageItem

A child record a package would carry.

Properties

  • Guid Id { get; init; }
    • Id of the child record.
  • ImportExportRecordType Type { get; init; }
    • The kind of child record, e.g. Archive.
  • string Name { get; init; }
    • A name to show for it.
  • long Size { get; init; }
    • Bytes of file the package would carry for it, such as an archive's; 0 for none.
  • DateTime? UpdatedOn { get; init; }
    • When it was last changed, or null for records that don't track it.

PasswordCheckResult​

record — LANCommander.Server.Plugins.PasswordCheckResult

The outcome of CheckPasswordAsync.

Properties

  • PasswordCheckStatus Status { get; init; }
  • UserAccount Account { get; init; }
    • The authenticated account. Set only when the check succeeded.
  • TimeSpan? RetryAfter { get; init; }
    • When rate limited, how long until the user name may be tried again.
  • bool Succeeded { get; }

PlaySessionEndedEvent​

record — LANCommander.Server.Plugins.PlaySessionEndedEvent

Raised when a play session ends. Times are UTC.

Properties

  • Guid SessionId { get; init; }
  • Guid GameId { get; init; }
  • Guid UserId { get; init; }
  • DateTime Start { get; init; }
  • DateTime End { get; init; }
  • bool TimedOut { get; init; }
    • The launcher stopped reporting in, so the server ended the session at the last time it heard from it.

PlaySessionStartedEvent​

record — LANCommander.Server.Plugins.PlaySessionStartedEvent

Raised when a player starts a game.

Properties

  • Guid SessionId { get; init; }
  • Guid GameId { get; init; }
  • Guid UserId { get; init; }
  • DateTime Start { get; init; }

PluginAccessAttribute​

attribute — LANCommander.Server.Plugins.PluginAccessAttribute

Declares who may reach a plugin-contributed routable component.

Properties

  • PluginAccessPolicy Policy { get; }
    • The policy the server enforces for the decorated component.

PluginAccessPolicy​

class — LANCommander.Server.Plugins.PluginAccessPolicy

Describes who may reach a plugin-contributed surface, such as a page or a navigation entry.

Properties

  • PluginAccessLevel Level { get; }
    • The kind of requirement this policy enforces.
  • IReadOnlyList<string> RequiredRoles { get; }
    • The roles accepted when Level is Role. Empty for every other level.

Methods

  • PluginAccessPolicy RequireRoles(string[] roles)
    • Allows members of any of the supplied server-defined roles. Administrators also qualify.
  • bool IsSatisfiedBy(ClaimsPrincipal user)
    • Determines whether user satisfies this policy.

PresenceChangedEvent​

record — LANCommander.Server.Plugins.PresenceChangedEvent

Raised when what other players see of a player changes: they start or stop playing, their game reports new activity, or they change their presence visibility. Games can report activity often, so keep handlers quick. A player who isn't playing can be reported as not playing again, for example when they change their visibility.

Properties

  • Guid UserId { get; init; }
  • UserPresence Presence { get; init; }
    • What everyone may see under the player's PresenceVisibility: no activity when it is GameOnly. Null when the player isn't shown as playing, because they stopped or their visibility is Hidden.

RecurringJobInfo​

record — LANCommander.Server.Plugins.RecurringJobInfo

A plugin recurring job, from Get.

Properties

  • string JobId { get; init; }
    • The id it was added with.
  • string CronExpression { get; init; }
    • Its schedule.
  • DateTime? NextExecution { get; init; }
    • When it next runs, in UTC, if it's scheduled to.
  • DateTime? LastExecution { get; init; }
    • When it last ran, in UTC, if it has since the server started.

RedistributableCreatedEvent​

record — LANCommander.Server.Plugins.RedistributableCreatedEvent

Raised after a redistributable is added, by hand, by an import or through IRedistributableProvider.

Properties

  • Guid RedistributableId { get; init; }
  • string Name { get; init; }

RedistributableDeletedEvent​

record — LANCommander.Server.Plugins.RedistributableDeletedEvent

Raised after a redistributable is deleted.

Properties

  • Guid RedistributableId { get; init; }
  • string Name { get; init; }

RedistributableInfo​

record — LANCommander.Server.Plugins.RedistributableInfo

Software games need installed alongside them, such as a runtime. Games link to redistributables through SetLinksAsync, or a game package's manifest.

Properties

  • Guid Id { get; init; }
    • Empty when adding a redistributable, to have the server choose one.
  • string Name { get; init; }
  • string Description { get; init; }
  • string Notes { get; init; }
  • string OptionSchema { get; init; }
    • The options games can pass it, as an option schema, or null.
  • string Version { get; init; }
    • The version of the newest archive, if any. Set by the server; ignored when writing.
  • DateTime CreatedOn { get; init; }
    • Set by the server; ignored when writing.
  • DateTime UpdatedOn { get; init; }
    • Set by the server; ignored when writing.

RedistributableUpdatedEvent​

record — LANCommander.Server.Plugins.RedistributableUpdatedEvent

Raised after a redistributable is saved.

Properties

  • Guid RedistributableId { get; init; }
  • string Name { get; init; }

SaveDeletedEvent​

record — LANCommander.Server.Plugins.SaveDeletedEvent

Raised after a cloud save and its file are deleted: by its owner, an administrator, or the server making room under a user's save count or storage limits.

Properties

  • Guid SaveId { get; init; }
  • Guid? GameId { get; init; }
  • Guid UserId { get; init; }

SavePathInfo​

record — LANCommander.Server.Plugins.SavePathInfo

A file, folder or registry path where a game keeps its saves.

Properties

  • Guid Id { get; init; }
  • SavePathType Type { get; init; }
  • string Path { get; init; }
  • string WorkingDirectory { get; init; }
  • bool IsRegex { get; init; }
    • Whether Path is a regular expression.
  • RuntimePlatform Platforms { get; init; }
    • The platforms the path applies to.
  • RecordOwner Owner { get; init; }
    • Set by the server; ignored when writing.

SaveUploadedEvent​

record — LANCommander.Server.Plugins.SaveUploadedEvent

Raised after a cloud save is uploaded and its file written.

Properties

  • Guid SaveId { get; init; }
  • Guid GameId { get; init; }
  • Guid UserId { get; init; }
  • long Size { get; init; }
  • RuntimePlatform Platforms { get; init; }

ScriptInfo​

record — LANCommander.Server.Plugins.ScriptInfo

A PowerShell script run at a point in the life of a game, redistributable, tool or server.

Properties

  • Guid Id { get; init; }
  • string Name { get; init; }
  • string Description { get; init; }
  • ScriptType Type { get; init; }
    • When the script runs, e.g. on install.
  • string Contents { get; init; }
  • bool RequiresAdmin { get; init; }
  • RuntimePlatform Platforms { get; init; }
    • The platforms the script runs on.
  • RecordOwner Owner { get; init; }
    • Set by the server; ignored when writing.

ServerConsoleInfo​

record — LANCommander.Server.Plugins.ServerConsoleInfo

A log file or RCON connection the LANCommander server shows for a game server.

Properties

  • Guid Id { get; init; }
  • Guid ServerId { get; init; }
    • Set by the server; ignored when writing.
  • string Name { get; init; }
  • ServerConsoleType Type { get; init; }
  • string Path { get; init; }
    • For a log file console: the file.
  • string Host { get; init; }
    • For an RCON console: the host to connect to.
  • int? Port { get; init; }
    • For an RCON console: the port to connect to.
  • string Password { get; init; }
    • For an RCON console: the password.

ServerCreatedEvent​

record — LANCommander.Server.Plugins.ServerCreatedEvent

Raised after a game server is added, by hand, by an import or through IServerProvider. Whether it is running is reported by ServerStatusChangedEvent.

Properties

  • Guid ServerId { get; init; }
  • Guid? GameId { get; init; }
  • string Name { get; init; }

ServerDeletedEvent​

record — LANCommander.Server.Plugins.ServerDeletedEvent

Raised after a game server is deleted.

Properties

  • Guid ServerId { get; init; }
  • Guid? GameId { get; init; }
  • string Name { get; init; }

ServerEngineConsole​

record — LANCommander.Server.Plugins.ServerEngineConsole

A console an IServerEngineExtension offers for one of its servers, listed under the server's Monitor beside the process output and the server's own log file consoles.

Properties

  • string Id { get; init; }
    • Identifies the console among the server's, e.g. logs or shell. It appears in the console's address, so keep it short; it is passed back to the engine when the console is opened.
  • string Name { get; init; }
    • The console's name in the menu and the page's header.
  • ServerEngineConsoleKind Kind { get; init; }
    • How the console is shown, which decides which of the engine's methods opens it.

ServerEngineEditorContext​

class — LANCommander.Server.Plugins.ServerEngineEditorContext

The server an EditorComponent edits, on its General page. Changes are kept with the page's other unsaved changes and saved with them.

Properties

  • ServerEngineServer Server { get; }
    • The server, with the page's unsaved changes. Its id is empty while it is being added.
  • bool IsNew { get; }
    • Whether the server is being added, so has no id yet.

Methods

  • T GetSettings<T>()
    • The engine's settings for the server; see GetSettings.
  • void SetSettings<T>(T settings)
    • Replaces the engine's settings for the server.
  • void SetAddress(string host, int? port)
    • Sets the address players connect to, e.g. from a port the engine publishes. The administrator can still change it. What is set here overrides what the engine reports with ReportAddress, so an engine that reports addresses should leave the parts it reports unset.

ServerEngineFile​

record — LANCommander.Server.Plugins.ServerEngineFile

A file or folder among a server's files, for Files; see ListFilesAsync.

Properties

  • string Name { get; init; }
    • The entry's name within the folder listed, without any path.
  • bool IsDirectory { get; init; }
    • Whether it is a folder.
  • long? Size { get; init; }
    • A file's length in bytes, where the engine knows it.
  • DateTime? LastModified { get; init; }
    • When it was last written, in UTC, where the engine knows.

ServerEngineLogLine​

record — LANCommander.Server.Plugins.ServerEngineLogLine

A line of a Log console.

Properties

  • string Text { get; init; }
    • The line, without its line ending.
  • DateTime? Timestamp { get; init; }
    • When it was written, in UTC, where the engine knows; otherwise when it was read.
  • bool IsError { get; init; }
    • Whether it came from the server's error output, so is shown as an error.

ServerEngineLogRequest​

record — LANCommander.Server.Plugins.ServerEngineLogRequest

What of a Log console to read.

Properties

  • int? Tail { get; init; }
    • How many of the latest lines to read back before following; null for all of them.
  • bool Follow { get; init; }
    • Whether to go on returning lines as they are written, until the reader cancels or the log ends, e.g. because the server stopped. When false, return what is there and finish.

ServerEngineProcessInfo​

record — LANCommander.Server.Plugins.ServerEngineProcessInfo

A sample of a running server's usage. Any member may be null when the engine can't tell.

Properties

  • int? Pid { get; init; }
    • The server's process id, where there is one the administrator would recognize.
  • DateTime? StartTime { get; init; }
    • When the server started, in UTC.
  • double? CpuPercent { get; init; }
    • CPU use as a share of the whole machine, from 0 to 100.
  • long? MemoryBytes { get; init; }
    • Memory in use.

ServerEngineSection​

record — LANCommander.Server.Plugins.ServerEngineSection

A page of a server's editor added by an IServerEngineExtension.

Properties

  • string Slug { get; init; }
    • The page's address under the server, /Servers/{id}/Engine/{Slug}: letters, digits and -, unique within the engine.
  • string Title { get; init; }
    • The page's name in the menu and its title.
  • Type Component { get; init; }
    • A Razor component rendered as the page, taking a ServerEngineServer as its Server parameter.

ServerEngineServer​

record — LANCommander.Server.Plugins.ServerEngineServer

A game server as an IServerEngineExtension sees it.

Properties

  • Guid Id { get; init; }
  • string Name { get; init; }
  • Guid? GameId { get; init; }
    • The game the server is for, if any.
  • string Host { get; init; }
    • The host players connect to, as the administrator set it; empty when they left it to what the engine reports. Not what the engine reported.
  • int Port { get; init; }
    • The port players connect to, as the administrator set it; 0 when they left it to what the engine reports.
  • string Settings { get; init; }
    • What the engine keeps about the server, as JSON, or empty when it has kept nothing yet. Read it with GetSettings.

Methods

  • T GetSettings<T>()
    • Settings read as T, or a new T when there are none or they can't be read.

ServerEngineSettings​

class — LANCommander.Server.Plugins.ServerEngineSettings

Reads and writes Settings.

Methods

  • T Read<T>(string json)
    • Reads settings JSON as T; a new one when it is empty or can't be read.
  • string Write<T>(T settings)
    • Writes settings as JSON.

ServerEngineSettingsContext​

class — LANCommander.Server.Plugins.ServerEngineSettingsContext

Given to an SettingsComponent on Settings › Servers, so the engine's configuration is saved along with the rest of the page.

Methods

  • IDisposable OnSave(Func<CancellationToken, Task> save)
    • Runs save whenever the administrator saves the page. Register it when the component is initialized, and dispose the result when it is disposed: the component is only created while its panel is open. Throw to report that the configuration couldn't be saved; the page shows the message, and the rest of the page is saved regardless.
  • IDisposable OnAdd(Func<Task> add)
    • Runs add when the administrator chooses the engine from the page's Add menu, listed with the built-in engines, e.g. to start adding a host. The engine's panel is opened first, so register when the component is initialized; if the engine was chosen before then, add runs as soon as it is registered. Dispose the result when the component is disposed. Without it, choosing the engine just opens its panel.

ServerFileInfo​

record — LANCommander.Server.Plugins.ServerFileInfo

A file or folder returned by ListFilesAsync.

Properties

  • string Name { get; init; }
    • The entry's name within the listed folder.
  • string Path { get; init; }
    • The path relative to the engine's file root, with "/" between folders.
  • bool IsDirectory { get; init; }
    • Whether the entry is a folder.
  • long? Size { get; init; }
    • A file's length in bytes, or null when unknown or a folder.
  • DateTime? LastModified { get; init; }
    • The last write time in UTC, or null when unknown.

ServerHttpPathInfo​

record — LANCommander.Server.Plugins.ServerHttpPathInfo

A folder of the game server the LANCommander server serves over HTTP.

Properties

  • Guid Id { get; init; }
  • Guid ServerId { get; init; }
    • Set by the server; ignored when writing.
  • string LocalPath { get; init; }
    • The folder on disk.
  • string Path { get; init; }
    • The URL path it is served under.

ServerInfo​

record — LANCommander.Server.Plugins.ServerInfo

A dedicated game server the LANCommander server runs and monitors.

Properties

  • Guid Id { get; init; }
    • Empty when adding a server, to have the LANCommander server choose one.
  • string Name { get; init; }
  • Guid? GameId { get; init; }
    • The game the server is for, if any.
  • ServerHostEngine Engine { get; init; }
  • string Path { get; init; }
    • The executable to run.
  • string Arguments { get; init; }
  • string WorkingDirectory { get; init; }
  • string OnStartScriptPath { get; init; }
  • string OnStopScriptPath { get; init; }
  • bool UseShellExecute { get; init; }
  • ProcessTerminationMethod ProcessTerminationMethod { get; init; }
  • string EngineExtensionId { get; init; }
    • For Extension: the engine's Id.
  • string EngineSettings { get; init; }
    • For Extension: the engine's settings for the server, as JSON.
  • Guid? RemoteHostId { get; init; }
    • For Remote: the LANCommander server that manages it.
  • Guid? RemoteServerId { get; init; }
    • For Remote: the server's id on that LANCommander server.
  • string Host { get; init; }
    • The address players connect to.
  • int Port { get; init; }
  • bool Autostart { get; init; }
  • ServerAutostartMethod AutostartMethod { get; init; }
  • int AutostartDelay { get; init; }
    • Seconds to wait before an automatic start.
  • DateTime CreatedOn { get; init; }
    • Set by the server; ignored when writing.
  • DateTime UpdatedOn { get; init; }
    • Set by the server; ignored when writing.

ServerNavigationAnchor​

class — LANCommander.Server.Plugins.ServerNavigationAnchor

Special values for After. Any other value is the route of a built-in link, or a ServerNavigationSection naming a built-in group.

ServerNavigationGroup​

class — LANCommander.Server.Plugins.ServerNavigationGroup

A ready-made IServerNavigationGroupExtension: services.AddSingleton<IServerNavigationGroupExtension>(new ServerNavigationGroup { Id = "com.mycompany.myplugin", Label = "My Plugin", Icon = "Package", Section = ServerNavigationSection.Main, });

Properties

  • string Id { get; init; }
  • string Label { get; init; }
  • string Icon { get; init; }
  • string Section { get; init; }
  • string After { get; init; }
  • int Order { get; init; }
  • PluginAccessPolicy Access { get; init; }

class — LANCommander.Server.Plugins.ServerNavigationLink

A ready-made IServerNavigationExtension, so a plugin can register any number of navigation entries without writing a class for each: services.AddSingleton<IServerNavigationExtension>(new ServerNavigationLink { Id = "com.mycompany.myplugin.catalog", Label = "Catalog", Href = "/Plugins/MyPlugin/Catalog", Section = "com.mycompany.myplugin", });

Properties

  • string Id { get; init; }
  • string Label { get; init; }
  • string Href { get; init; }
  • string Icon { get; init; }
  • string Section { get; init; }
  • string After { get; init; }
  • int Order { get; init; }
  • PluginAccessPolicy Access { get; init; }

ServerNavigationSection​

class — LANCommander.Server.Plugins.ServerNavigationSection

Identifiers of the server navigation sections a plugin entry can be placed in through Section. A group's identifier is also the After anchor that places an entry after the group.

ServerSection​

record — LANCommander.Server.Plugins.ServerSection

A page an IServerSectionExtension adds to a game server.

Properties

  • string Slug { get; init; }
    • The page's address under the extension, /Servers/{id}/Plugin/{extension}/{Slug}: letters, digits and -, unique among the pages the extension adds to the server.
  • string Title { get; init; }
    • The page's name in the menu and its title.
  • Type Component { get; init; }
    • A Razor component rendered as the page, taking the ServerInfo as its Server parameter and the server's id as its ServerId parameter.

ServerStatusChangedEvent​

record — LANCommander.Server.Plugins.ServerStatusChangedEvent

Raised when a game server's status changes, whichever engine runs it, including one a plugin adds.

Properties

  • Guid ServerId { get; init; }
  • string ServerName { get; init; }
  • ServerEngineStatus Status { get; init; }
  • string Error { get; init; }
    • Why the server failed, when Status is Error.

ServerUpdatedEvent​

record — LANCommander.Server.Plugins.ServerUpdatedEvent

Raised after a game server's settings are saved.

Properties

  • Guid ServerId { get; init; }
  • Guid? GameId { get; init; }
  • string Name { get; init; }

StorageLocationInfo​

record — LANCommander.Server.Plugins.StorageLocationInfo

A storage location on the server.

Properties

  • Guid Id { get; init; }
    • Id to pass back to the server, for example as an import's storage location.
  • string Path { get; init; }
    • Where the location is on the server's file system.
  • StorageLocationType Type { get; init; }
    • What the location stores.
  • bool Default { get; init; }
    • Whether the server uses this location when none is chosen.

TaxonomyInfo​

record — LANCommander.Server.Plugins.TaxonomyInfo

A taxonomy record on the server.

Properties

  • Guid Id { get; init; }
  • TaxonomyKind Kind { get; init; }
  • string Name { get; init; }

ToolCreatedEvent​

record — LANCommander.Server.Plugins.ToolCreatedEvent

Raised after a tool is added, by hand, by an import or through IToolProvider.

Properties

  • Guid ToolId { get; init; }
  • string Name { get; init; }

ToolDeletedEvent​

record — LANCommander.Server.Plugins.ToolDeletedEvent

Raised after a tool is deleted.

Properties

  • Guid ToolId { get; init; }
  • string Name { get; init; }

ToolInfo​

record — LANCommander.Server.Plugins.ToolInfo

A program players can install alongside the games that use it, such as a mod manager.

Properties

  • Guid Id { get; init; }
    • Empty when adding a tool, to have the server choose one.
  • string Name { get; init; }
  • string Description { get; init; }
  • string Notes { get; init; }
  • bool AlwaysInstall { get; init; }
    • Whether the tool is installed with its games without asking.
  • DateTime CreatedOn { get; init; }
    • Set by the server; ignored when writing.
  • DateTime UpdatedOn { get; init; }
    • Set by the server; ignored when writing.

ToolUpdatedEvent​

record — LANCommander.Server.Plugins.ToolUpdatedEvent

Raised after a tool is saved.

Properties

  • Guid ToolId { get; init; }
  • string Name { get; init; }

UserAccount​

record — LANCommander.Server.Plugins.UserAccount

A user account on the server.

Properties

  • Guid Id { get; init; }
  • string UserName { get; init; }
  • string Alias { get; init; }
    • The name the user chose to be shown by, if any.
  • string Email { get; init; }
  • IReadOnlyList<string> Roles { get; init; }
    • The names of the roles the user is in.
  • bool IsAdministrator { get; init; }
    • Whether the user is in the built-in administrator role.
  • bool CanSignIn { get; init; }
    • Whether the server would let the user sign in right now: the account is not locked out and, where the server requires it, has been approved by an administrator. Read from the account each time, so a lockout or a withdrawn approval takes effect immediately.
  • DateTime CreatedOn { get; init; }

UserApprovedEvent​

record — LANCommander.Server.Plugins.UserApprovedEvent

Raised when an administrator approves an account that wasn't approved.

Properties

  • Guid UserId { get; init; }
  • string UserName { get; init; }

UserCreatedEvent​

record — LANCommander.Server.Plugins.UserCreatedEvent

Raised after a user account is created, by registration, an administrator or an external sign-in. The server's default role may be added to the account just after.

Properties

  • Guid UserId { get; init; }
  • string UserName { get; init; }
  • bool Approved { get; init; }
    • Whether the account was approved on creation; if not, UserApprovedEvent follows when it is.

UserDeletedEvent​

record — LANCommander.Server.Plugins.UserDeletedEvent

Raised after a user account is deleted.

Properties

  • Guid UserId { get; init; }
  • string UserName { get; init; }

UserSignedInEvent​

record — LANCommander.Server.Plugins.UserSignedInEvent

Raised when a user signs in to the server: a launcher or API client getting a token, or a browser sign-in, including through an external provider. Refreshing a token doesn't raise it.

Properties

  • Guid UserId { get; init; }
  • string UserName { get; init; }

UserSignedOutEvent​

record — LANCommander.Server.Plugins.UserSignedOutEvent

Raised when a client reports a sign-out or a browser session is signed out. Tokens already issued to the user stay valid until they expire.

Properties

  • Guid UserId { get; init; }
  • string UserName { get; init; }

RecordOwner​

struct — LANCommander.Server.Plugins.RecordOwner

The record a child record (an action, script, save path, archive…) belongs to.

Properties

  • RecordOwnerKind Kind { get; init; }
    • What kind of record the owner is.
  • Guid Id { get; init; }
    • The owner's id.
  • Guid? VersionId { get; init; }
    • For a game's actions, scripts and save paths, the game version they belong to. Null means the game's latest version. Ignored for every other kind of owner and child.

Methods

  • RecordOwner Game(Guid id, Guid? versionId)
    • A game, or one of its versions.
  • RecordOwner Redistributable(Guid id)
  • RecordOwner Tool(Guid id)
  • RecordOwner Server(Guid id)

ServerEngineTerminalSize​

struct — LANCommander.Server.Plugins.ServerEngineTerminalSize

A terminal's size, in characters.

Properties

  • int Columns { get; init; }
  • int Rows { get; init; }

ExternalServerFeatures​

enum — LANCommander.Server.Plugins.ExternalServerFeatures

What can be done with a ExternalServer beyond seeing its status.

ValueDescription
None = 0
Log = 1Its output can be read; see ReadLogAsync.
Commands = 2Commands can be sent to it while it runs; see SendCommandAsync.
ProcessInfo = 4Its CPU, memory and uptime can be sampled; see GetProcessInfoAsync.

GameLinkKind​

enum — LANCommander.Server.Plugins.GameLinkKind

The kinds of record a game is linked to, other than its engine.

ValueDescription
Categories = 0Category records.
Collections = 1Collection records.
Developers = 2Company records.
Genres = 3Genre records.
Platforms = 4Platform records.
Publishers = 5Company records.
Tags = 6Tag records.
Redistributables = 7Redistributables, which the game's latest version installs alongside it.
Tools = 8Tools.

PasswordCheckStatus​

enum — LANCommander.Server.Plugins.PasswordCheckStatus

ValueDescription
Succeeded = 0The password is correct and the account may sign in.
Failed = 1The user name or password is wrong. Deliberately does not say which, so the result cannot be used to find out whether a user exists.
LockedOut = 2The account is locked out. Its password was not checked.
NotApproved = 3The account is waiting for an administrator's approval. Its password was not checked.
RateLimited = 4Too many recent failures for this user name. Nothing was checked; see RetryAfter.
Disabled = 5The server has password sign-in turned off.

PluginAccessLevel​

enum — LANCommander.Server.Plugins.PluginAccessLevel

The kind of requirement a PluginAccessPolicy enforces.

ValueDescription
Administrator = 0Only members of the built-in administrator role. This is the default for any plugin surface that does not declare a policy.
AuthenticatedUser = 1Any signed-in user. Anonymous visitors are always rejected.
Role = 2Members of specific server-defined roles. Administrators always qualify.

RecordOwnerKind​

enum — LANCommander.Server.Plugins.RecordOwnerKind

The kinds of record that own actions, scripts and the other child records.

ValueDescription
Game = 0
Redistributable = 1
Tool = 2
Server = 3

ServerDockPosition​

enum — LANCommander.Server.Plugins.ServerDockPosition

The edge an IServerDockExtension's bar is docked to.

ValueDescription
Top = 0Along the top of the window, above the navigation and the page.
Bottom = 1Along the bottom of the window, below the navigation and the page.

ServerEngineConsoleKind​

enum — LANCommander.Server.Plugins.ServerEngineConsoleKind

How a ServerEngineConsole is shown.

ValueDescription
Log = 0Lines the server has written, read back and then followed, e.g. a container's log, shown like the process output with the server's command bar under it. Opened with ReadLogAsync.
Terminal = 1An interactive terminal, e.g. the server's own console or a shell beside it. Keystrokes go to the engine as they are typed and what it writes back is drawn as a terminal draws it, escape sequences included. Opened with OpenTerminalAsync.

ServerEngineFeatures​

enum — LANCommander.Server.Plugins.ServerEngineFeatures

What an IServerEngineExtension can do beyond starting and stopping a server.

ValueDescription
None = 0
Output = 1The engine reports its servers' output through WriteOutput, shown on their Monitor page.
Input = 2The engine can write lines to its servers' input, from their Monitor page.
ProcessInfo = 4The engine samples its servers' CPU and memory use and uptime.
Consoles = 8The engine offers consoles of its own for its servers, e.g. a log or a terminal, listed under their Monitor; see GetConsoles.
Files = 16The engine can list, read, write and delete its servers' files, e.g. their configuration, so administrators can edit and upload them on the server's Files page; see ListFilesAsync.
Address = 32The engine knows where players connect to its servers, e.g. the address and port a container was given, and reports it through ReportAddress. Players are sent the reported host and port wherever the administrator left the server's own blank; what they enter there overrides the report.

ServerEngineStatus​

enum — LANCommander.Server.Plugins.ServerEngineStatus

Whether a game server is running.

ValueDescription
Stopped = 0
Starting = 1
Running = 2
Stopping = 3
Error = 4The server failed, e.g. it exited on its own with an error.

ServerHostEngine​

enum — LANCommander.Server.Plugins.ServerHostEngine

Where a game server runs.

ValueDescription
Local = 0A process on the LANCommander server's machine.
Remote = 2A server managed by another LANCommander server.
Extension = 3A plugin's IServerEngineExtension, named by EngineExtensionId.

TaxonomyKind​

enum — LANCommander.Server.Plugins.TaxonomyKind

The kinds of taxonomy record: named records games are linked to.

ValueDescription
Category = 0
Collection = 1
Company = 2A developer or publisher.
Engine = 3
Genre = 4
Platform = 5
Tag = 6

LANCommander.Server.Plugins.Data​

PluginDataIds​

class — LANCommander.Server.Plugins.Data.PluginDataIds

The rules for a plugin's DataId, and the names it gives the plugin's database objects: tables Plugin_Timesheet_Entries, keys PK_Plugin_Timesheet_Entries, indexes IX_Plugin_Timesheet_Entries_Name, and history __EFMigrationsHistory_Plugin_Timesheet.

Methods

  • string TablePrefix(string dataId)
    • The prefix of the plugin's table names.
  • string HistoryTable(string dataId)
    • The plugin's own migrations history table.
  • string Prefixed(string dataId, string name)
    • Puts the plugin's prefix into the name of a table, key, index or foreign key, once. A name of EF Core's usual shape keeps its marker first, as the server's own do (PK_Entries becomes PK_Plugin_Timesheet_Entries); any other name is prefixed at the start.
  • string Validate(string dataId)
    • Why dataId can't be used, or null when it can.

PluginDataServiceCollectionExtensions​

class — LANCommander.Server.Plugins.Data.PluginDataServiceCollectionExtensions

Methods

  • IServiceCollection AddPluginDbContext<TContext>(IServiceCollection services)
    • Asks the host to register TContext, scoped, along with an IDbContextFactory<TContext>. Call it from IPlugin.ConfigureServices.

PluginDataState​

record — LANCommander.Server.Plugins.Data.PluginDataState

A plugin context's status, with every error that put it there.

Properties

  • PluginDataStatus Status { get; init; }
  • IReadOnlyList<string> Errors { get; init; }

PluginDataUnavailableException​

class — LANCommander.Server.Plugins.Data.PluginDataUnavailableException

A plugin context was asked for, or tried to connect, before it was ready. Carries the context's state and every error, so the plugin's log shows exactly which check failed.

Properties

  • Type ContextType { get; }
  • PluginDataState State { get; }

PluginDbContext​

class — LANCommander.Server.Plugins.Data.PluginDbContext

The base of a plugin's own DbContext. The plugin defines its entities in ConfigureModel; the host owns everything else: the connection, the engine, the migrations history table, and naming every table, key and index after the plugin, as in Plugin_Timesheet_Entries and PK_Plugin_Timesheet_Entries.

Properties

  • string DataId { get; }
    • The plugin's DataId, which prefixes its database objects.

PluginDbContextOptionsExtensions​

class — LANCommander.Server.Plugins.Data.PluginDbContextOptionsExtensions

Methods

  • DbContextOptionsBuilder UsePluginIdentity(DbContextOptionsBuilder builder, string dataId)
    • Gives a PluginDbContext the plugin's DataId. Called by the host, and by design-time factories that generate a plugin's migrations, so the migrations name things the way the host will.

PluginDbContextRegistration​

record — LANCommander.Server.Plugins.Data.PluginDbContextRegistration

A plugin's request for the host to register one of its contexts.

Properties

  • Type ContextType { get; init; }

PluginIdentityExtension​

class — LANCommander.Server.Plugins.Data.PluginIdentityExtension

Carries a plugin's DataId into its context's options.

Properties

  • string DataId { get; }
  • DbContextOptionsExtensionInfo Info { get; }

Methods

  • void ApplyServices(IServiceCollection services)
  • void Validate(IDbContextOptions options)

PluginMigrationsAttribute​

attribute — LANCommander.Server.Plugins.Data.PluginMigrationsAttribute

Declares that an assembly holds the migrations of one PluginDbContext for one database engine. A plugin ships one such assembly per engine per context, each with its own model snapshot, and lists them in [LANCommanderPlugin(MigrationAssemblies = ...)].

Properties

  • Type ContextType { get; }
  • DatabaseEngine Engine { get; }

PluginModelConventions​

class — LANCommander.Server.Plugins.Data.PluginModelConventions

What the host does to every plugin model after the plugin has configured it: names its tables, keys and indexes after the plugin (see Prefixed), and gives date and time properties converters that behave the same on every engine.

Methods

  • void Apply(ModelBuilder modelBuilder, string dataId)

PluginValueConverters​

class — LANCommander.Server.Plugins.Data.PluginValueConverters

Converters that make types behave the same on every engine. The host applies UtcDateTime and UtcTicks to every DateTime and DateTimeOffset property itself; a Decimal property needs ScaledInteger applied by the plugin, since only the plugin knows its scale.

Methods

  • ValueConverter<decimal, long> ScaledInteger(int scale)
    • Stores Decimal as a whole number of 10^-scale units, which every engine can compare and order; SQLite otherwise stores decimals as text. Values are rounded to scale places.

PortabilityRules​

class — LANCommander.Server.Plugins.Data.PortabilityRules

What a plugin model may not do, so it behaves the same on SQLite, MySQL and PostgreSQL. The host checks the model as its own engine builds it, and refuses a plugin that breaks any of these.

Methods

  • IReadOnlyList<string> Check(IModel model, DatabaseEngine engine, string dataId)
    • Every way model breaks the rules, as messages naming the entity and property.

DatabaseEngine​

enum — LANCommander.Server.Plugins.Data.DatabaseEngine

The database engines a LANCommander server can run on.

ValueDescription
Sqlite = 0
MySql = 1
PostgreSql = 2

PluginDataStatus​

enum — LANCommander.Server.Plugins.Data.PluginDataStatus

Where a plugin context is in being made ready for use.

ValueDescription
Unvalidated = 0Not checked yet.
Invalid = 1Its migrations or model failed a check; the plugin is turned off.
Validated = 2Its migrations passed every check, but haven't been applied, e.g. while the server has no database yet.
Migrating = 3Its migrations are being applied.
MigrationFailed = 4Applying its migrations failed; the plugin is turned off until an administrator retries.
Ready = 5Checked and migrated; the context can be used.

LANCommander.Server.Plugins.Messaging​

IServerEventConsumer​

interface — LANCommander.Server.Plugins.Messaging.IServerEventConsumer

Receives every published ServerEvent, for example to forward it to Slack. Register an implementation in IPlugin.ConfigureServices. Consumers run in the background after the originating operation and are isolated from each other. Consumers own their own filtering, retries and persistence: an exception is logged and the event is dropped for that consumer.

Methods

  • Task HandleAsync(ServerEvent serverEvent, CancellationToken cancellationToken)

IServerEventTransport​

interface — LANCommander.Server.Plugins.Messaging.IServerEventTransport

Replaces the default in-memory transport that carries server events, for example with RabbitMQ. Register one implementation in IPlugin.ConfigureServices; when several are registered, the first is used. Every server instance sharing the transport consumes from the same queue, so each event is handled by one instance.

Methods

  • void ConfigureTransport(StandardConfigurer<ITransport> transport, string queueName)
    • Configures the Rebus transport, consuming from queueName.
  • void ConfigureSubscriptions(StandardConfigurer<ISubscriptionStorage> subscriptions)
    • Configures subscription storage for transports without native publish/subscribe support. Brokers such as RabbitMQ do not need this.